-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUG] Incorrect schema name handling in selectable for SQLAlchemy (Bigquery) #10333
Comments
Apart from the suggestion above, would you have other suggestion to resolve this issue? |
Hi @TaerimL! Thank you for bringing this to our attention - i'll be sharing this with the team and will follow up on progress. In the meantime, since you've offered a potential solution, I'd like to mention that we always welcome code contributions. if interested, you can find more details about contributing here |
Hi @TaerimL , do you have a script handy that will reproduce the issue? The fix you've suggested sounds reasonable, but I'd like to reproduce it using public methods from an end-user flow. Also, it looks like you are on gx version 0.18. We're focusing our efforts on version 1.0 now, so our team will likely just fix it in 1.0. Thanks! |
Hello @tyler-hoffman, you can regenerate by setting the following arguments: runtime_parameters={ "query": sql_query, "temp_table_schema_name": temp_table_dataset } in RuntimeBatchRequest, and create_temp_table=True and temp_table_dataset = temp_table_dataset in BigQueryQualityChecker, thank you :) |
Hi @TaerimL, have you had a chance to upgrade to v1.x yet? I need to confirm whether this is an issue in our latest release before we can proceed with any further actions |
Describe the bug
I am encountering an issue when running validation with SQLAlchemy (BigQuery). Specifically, when generating a selectable with a query, the returned table object for temporary table has the schema referenced twice: once within the table name and another time within the schema attribute.
Consequently, the table reference, built using selectatble, is incorrectly formatted as
schema_name.schema_name.table_name
. instead ofschema_name.table_name
. This is problematic in BigQuery because the table name is already qualified with its schema name. This incorrectly formatted Table object is referenced during validations and fails.It seems that the issue was handled for the function _generate_selectable_from_schema_name_and_table_name but not on generating it with a query.
To Reproduce
This behavior can be observed with the following arguments to the function _generate_selectable_from_query when the
dialect = GXSqlDialect.BIGQUERY
.Expected behavior
In the function "_generate_selectable_from_query", the selectable should be in the format
schema_name.table_name
whendialect = GXSqlDialect.BIGQUERY
.I would like to suggest a possible solution below:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: