From 02f7a89a5bab582ca01d9ba925361b5a9075645b Mon Sep 17 00:00:00 2001 From: Pankaj Singh <98807258+pankajastro@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:16:57 +0530 Subject: [PATCH] Fix regex for var `allowed_deserialization_classes` (#2125) AstroSDK test seem to be failing on below PR PR: https://github.com/astronomer/astro-sdk/pull/2124 CI Job: https://github.com/astronomer/astro-sdk/actions/runs/8158059156/job/22301955847?pr=2124 --- python-sdk/example_dags/example_dataframe_api.py | 2 +- python-sdk/noxfile.py | 4 ++-- python-sdk/pyproject.toml | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python-sdk/example_dags/example_dataframe_api.py b/python-sdk/example_dags/example_dataframe_api.py index aea1722ba..5215735a4 100644 --- a/python-sdk/example_dags/example_dataframe_api.py +++ b/python-sdk/example_dags/example_dataframe_api.py @@ -60,7 +60,7 @@ def find_worst_covid_month(dfs: List[pd.DataFrame]): """ res = {} for covid_month_data in dfs: - if ALLOWED_DESERIALIZATION_CLASSES == "airflow\\.* astro\\.*": + if ALLOWED_DESERIALIZATION_CLASSES == "airflow.* astro.*": covid_month = datetime.fromtimestamp(covid_month_data.Date_YMD.iloc[0] / 1e3).strftime("%Y-%m") else: covid_month = covid_month_data.Date_YMD.iloc[0].__format__("%Y-%m") diff --git a/python-sdk/noxfile.py b/python-sdk/noxfile.py index d49473d41..c725582b8 100644 --- a/python-sdk/noxfile.py +++ b/python-sdk/noxfile.py @@ -25,7 +25,7 @@ def test(session: nox.Session, airflow) -> None: """Run both unit and integration tests.""" env = { "AIRFLOW_HOME": f"~/airflow-{airflow}-python-{session.python}", - "AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow\\.* astro\\.*", + "AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow.* astro.*", } session.install(f"apache-airflow~={airflow}") @@ -73,7 +73,7 @@ def test_examples_by_dependency(session: nox.Session, extras): env = { "AIRFLOW_HOME": "~/airflow-latest-python-latest", - "AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow\\.* astro\\.*", + "AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow.* astro.*", } session.install("-e", f".[{pypi_deps}]") diff --git a/python-sdk/pyproject.toml b/python-sdk/pyproject.toml index adb648706..643299dc2 100644 --- a/python-sdk/pyproject.toml +++ b/python-sdk/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "pandas<2.2.0", # Versions 2.2.0 seems to be breaking our tests, so pin it to this version temporarily. "pyarrow", "python-frontmatter", - "smart-open", + "smart-open<7.0.0", "SQLAlchemy>=1.3.18", "Flask-Session<0.6.0" # This release breaking our tests, let's pin it as a temporary workaround ] @@ -57,7 +57,7 @@ google = [ "protobuf", "apache-airflow-providers-google>=6.4.0", "sqlalchemy-bigquery>=1.3.0", - "smart-open[gcs]>=5.2.1" + "smart-open[gcs]>=5.2.1,<7.0.0" ] snowflake = [ "apache-airflow-providers-snowflake", @@ -70,20 +70,20 @@ postgres = [ amazon = [ "apache-airflow-providers-amazon>=5.0.0", "s3fs", - "smart-open[s3]>=5.2.1", + "smart-open[s3]>=5.2.1,<7.0.0", ] azure = [ "apache-airflow-providers-microsoft-azure", "azure-storage-blob", - "smart-open[azure]>=5.2.1", + "smart-open[azure]>=5.2.1,<7.0.0", ] sftp = [ "apache-airflow-providers-sftp>=4.0.0", - "smart-open[ssh]>=5.2.1", + "smart-open[ssh]>=5.2.1,<7.0.0", ] ftp = [ "apache-airflow-providers-ftp>=3.0.0", - "smart-open>=5.2.1", + "smart-open>=5.2.1,<7.0.0", ] openlineage = [ "apache-airflow-providers-openlineage>=1.4.0", @@ -115,7 +115,7 @@ all = [ "apache-airflow-providers-postgres", "apache-airflow-providers-snowflake", "apache-airflow-providers-sftp", - "smart-open[all]>=5.2.1", + "smart-open[all]>=5.2.1,<7.0.0", "snowflake-connector-python[pandas]", "snowflake-sqlalchemy>=1.2.0", "sqlalchemy-bigquery>=1.3.0",