Skip to content

[snowflake] Proxy Port IntegerField silently blocks Snowflake connection form save when left blank #65443

Description

@nikhilcss97

Under which category would you file this issue?

Providers

Apache Airflow version

2.11.2

What happened and how to reproduce it?

In the Snowflake connection form (Add or Edit), clicking Save does nothing when the newly added Proxy Port field is left blank:

  • no success banner
  • no flash error
  • no 4xx in the browser network tab
  • the connection is not created or updated

Entering any integer in Proxy Port (for example 0 or 8080) allows the form to save successfully.

Root cause:

SnowflakeHook.get_connection_form_widgets declares the field as:

# providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py
"proxy_port": IntegerField(lazy_gettext("Proxy Port")),

WTForms IntegerField without Optional() fails validation on empty input because an empty string cannot be coerced to int. FAB then silently re-renders the form without persisting any changes, which is why the Save button appears to do nothing.

Meanwhile the runtime already treats proxy_port as optional in SnowflakeHook._get_conn_params:

proxy_port = self._get_field(extra_dict, "proxy_port")
...
if proxy_port:
    conn_config["proxy_port"] = int(proxy_port) if isinstance(proxy_port, str) else proxy_port

So the field is optional by design, and the UI behavior is inconsistent with every other code path (CLI, env-var, REST API, secrets backends all accept an absent proxy_port).


### What you think should happen instead?

`Proxy Port` should be optional in the UI, consistent with the other proxy fields (`proxy_host`, `proxy_user`, `proxy_password` are all `StringField`/`PasswordField` and accept empty input) and with the documented optional semantics of `proxy_port`.

Proposed fix: mark the field optional so WTForms short-circuits validation for empty input.

```python
from wtforms.validators import Optional

"proxy_port": IntegerField(
    lazy_gettext("Proxy Port"),
    widget=BS3TextFieldWidget(),
    validators=[Optional()],
),

Operating System

Debian GNU/Linux 12 (bookworm)

Deployment

None

Apache Airflow Provider(s)

snowflake

Versions of Apache Airflow Providers

apache-airflow-providers-snowflake==6.12.0

Official Helm Chart version

1.15.0

Kubernetes Version

1.30

Helm Chart configuration

No response

Docker Image customizations

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerskind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetprovider:snowflakeIssues related to Snowflake provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions