Skip to content

Commit

Permalink
Fix CI failures (#2105)
Browse files Browse the repository at this point in the history
Fix CI failures.

Limit pandas to <2.2.0 as it breaks our tests. 2.2.0 was released on Jan
20, 2024 and there is an open issue reported for this
pandas-dev/pandas#57053. We are getting the
same error as reported in the issue.

---------

Co-authored-by: Pankaj <pankaj.singh@astronomer.io>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 24, 2024
1 parent 5c011cb commit 97cc7c7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 30 deletions.
2 changes: 1 addition & 1 deletion python-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requires-python = ">=3.8"
dependencies = [
"apache-airflow>=2.7",
"attrs>=20.3.0",
"pandas",
"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",
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/src/astro/sql/operators/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
try:
from airflow.decorators.base import TaskDecorator, task_decorator_factory
except ImportError: # pragma: no cover
from airflow.decorators import _TaskDecorator as TaskDecorator
from airflow.decorators import _TaskDecorator as TaskDecorator # type: ignore[attr-defined]
from airflow.decorators.base import task_decorator_factory

from astro.constants import ColumnCapitalization, LoadExistStrategy
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/src/astro/sql/operators/raw_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
try:
from airflow.decorators.base import TaskDecorator
except ImportError:
from airflow.decorators import _TaskDecorator as TaskDecorator
from airflow.decorators import _TaskDecorator as TaskDecorator # type: ignore[attr-defined]

import airflow
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/src/astro/sql/operators/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
try:
from airflow.decorators.base import TaskDecorator
except ImportError:
from airflow.decorators import _TaskDecorator as TaskDecorator
from airflow.decorators import _TaskDecorator as TaskDecorator # type: ignore[attr-defined]

from airflow.decorators.base import get_unique_task_id, task_decorator_factory
from airflow.models.xcom_arg import XComArg
Expand Down
34 changes: 8 additions & 26 deletions python-sdk/tests_integration/databases/test_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,14 @@ def test_snowflake_create_table_with_columns(database_table_fixture):
response = database.run_sql(statement, handler=lambda x: x.fetchall())
rows = response
assert len(rows) == 2
assert rows[0] == (
"ID",
"NUMBER(38,0)",
"COLUMN",
"N",
"IDENTITY START 1 INCREMENT 1 ORDER",
"Y",
"N",
None,
None,
None,
None,
)
assert rows[1] == (
"NAME",
"VARCHAR(60)",
"COLUMN",
"N",
None,
"N",
"N",
None,
None,
None,
None,
)

assert rows[0][0] == "ID"
assert rows[0][1] == "NUMBER(38,0)"
assert rows[0][2] == "COLUMN"

assert rows[1][0] == "NAME"
assert rows[1][1] == "VARCHAR(60)"
assert rows[1][2] == "COLUMN"


@pytest.mark.integration
Expand Down

0 comments on commit 97cc7c7

Please sign in to comment.