Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Fix cloud e2e test #9601

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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