Skip to content

Commit

Permalink
[MAINTENANCE] Fix cloud e2e test (#9601)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilo59 authored and deborahniesz committed Mar 11, 2024
1 parent d0f1c96 commit a4ae55f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/integration/cloud/end_to_end/test_snowflake_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,38 @@ def datasource(
connection_string=connection_string,
create_temp_table=False,
)
datasource.create_temp_table = True
updated_connection_string = f"{connection_string}&foo=bar"

datasource.connection_string = updated_connection_string # type: ignore[assignment] # is a str
datasource = context.sources.add_or_update_snowflake(datasource=datasource)
assert (
datasource.create_temp_table is True
datasource.connection_string == updated_connection_string
), "The datasource was not updated in the previous method call."
datasource.create_temp_table = False
datasource.connection_string = connection_string # type: ignore[assignment] # is a str
datasource = context.add_or_update_datasource(datasource=datasource) # type: ignore[assignment]
assert (
datasource.create_temp_table is False
datasource.connection_string == connection_string
), "The datasource was not updated in the previous method call."
datasource.create_temp_table = True
datasource.connection_string = updated_connection_string # type: ignore[assignment] # is a str
datasource_dict = datasource.dict()
# this is a bug - LATIKU-448
# call to datasource.dict() results in a ConfigStr that fails pydantic
# validation on SnowflakeDatasource
datasource_dict["connection_string"] = str(datasource_dict["connection_string"])
datasource = context.sources.add_or_update_snowflake(**datasource_dict)
assert (
datasource.create_temp_table is True
datasource.connection_string == updated_connection_string
), "The datasource was not updated in the previous method call."
datasource.create_temp_table = False
datasource.connection_string = connection_string # type: ignore[assignment] # is a str
datasource_dict = datasource.dict()
# this is a bug - LATIKU-448
# call to datasource.dict() results in a ConfigStr that fails pydantic
# validation on SnowflakeDatasource
datasource_dict["connection_string"] = str(datasource_dict["connection_string"])
datasource = context.add_or_update_datasource(**datasource_dict) # type: ignore[assignment]
_ = context.add_or_update_datasource(**datasource_dict)
datasource = context.get_datasource(datasource_name=datasource_name) # type: ignore[assignment]
assert (
datasource.create_temp_table is False
datasource.connection_string == connection_string
), "The datasource was not updated in the previous method call."
return datasource

Expand Down

0 comments on commit a4ae55f

Please sign in to comment.