Skip to content

Breaking f-string for Python versions less than 3.12 #114

@jabortell

Description

@jabortell

In ./providers/snowflake/transfers/s3_to_snowflake.py, this line causes a SyntaxError if running a Python version less than 3.12:

if delete_all:
    if len(names):
        names_string = f"AND name in ('{"', '".join(names)}')"
# Results in:
#     ... stacktrace...
#     names_string = f"AND name in ('{"', '".join(names)}')"
# SyntaxError: f-string: expecting '}'

We think this was a change in 3.12 to support re-using quotes: PEP 701: Syntactic formalization of f-strings.

Confirmed that when running Airflow 2.9.3 and Python 3.11, 3.10, 3.9, or 3.8, this results in the SyntaxError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions