Skip to content

Commit

Permalink
Chore: lift pydantic <2.6.0 dev version pin (#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas authored Jan 28, 2025
1 parent cc0653c commit 37fcce5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"pandas-stubs",
"pre-commit",
"psycopg2-binary",
"pydantic<2.6.0",
"pydantic",
"PyAthena[Pandas]",
"PyGithub",
"pyspark~=3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ def test_get_model_mixed_dialects(copy_to_temp_path):
model = load_sql_based_model(expression, default_catalog=context.default_catalog)
context.upsert_model(model)

assert context.get_model("sushi.snowflake_dialect") == model
assert context.get_model("sushi.snowflake_dialect").dict() == model.dict()


def test_override_dialect_normalization_strategy():
Expand Down
24 changes: 23 additions & 1 deletion tests/core/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,29 @@ def test_json_serde():

deserialized_model = SqlModel.parse_raw(model_json)

assert deserialized_model == model
assert deserialized_model.dict() == model.dict()

expressions = parse(
"""
MODEL (
name test_model,
kind FULL,
dialect duckdb,
);
SELECT
x ~ y AS c
"""
)

model = load_sql_based_model(expressions)
model_json = model.json()
model_json_parsed = json.loads(model.json())

assert (
SqlModel.parse_obj(model_json_parsed).render_query().sql("duckdb")
== 'SELECT REGEXP_MATCHES("x", "y") AS "c"'
)


def test_scd_type_2_by_col_serde():
Expand Down
6 changes: 4 additions & 2 deletions tests/schedulers/airflow/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ def test_get_environment(mocker: MockerFixture, snapshot: Snapshot):
client = AirflowClient(airflow_url=common.AIRFLOW_LOCAL_URL, session=requests.Session())
result = client.get_environment("dev")

assert result == environment
assert result is not None
assert result.dict() == environment.dict()

get_environment_mock.assert_called_once_with(
"http://localhost:8080/sqlmesh/api/v1/environments/dev"
Expand All @@ -318,7 +319,8 @@ def test_get_environments(mocker: MockerFixture, snapshot: Snapshot):
client = AirflowClient(airflow_url=common.AIRFLOW_LOCAL_URL, session=requests.Session())
result = client.get_environments()

assert result == [environment]
assert len(result) == 1
assert result[0].dict() == environment.dict()

get_environments_mock.assert_called_once_with(
"http://localhost:8080/sqlmesh/api/v1/environments"
Expand Down

0 comments on commit 37fcce5

Please sign in to comment.