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

[BUGFIX] Pass the temp_table_schema_name to SQLAlchemyBatchData class #10572

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mathiasflorin
Copy link

@mathiasflorin mathiasflorin commented Oct 25, 2024

Pass temp_table_schema_name to the SQLAlchemyBatchData class to configure the temporary table in Snowflake.

I didn't run the tests because compiling pandas failed on my MacBook Pro, and I didn't want to spend more time on it.

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • [] Appropriate tests and docs have been updated

For more information about contributing, see Contribute.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Pass batch_spec_passthrough to the SQLAlchemyBatchData so that the user can configure a temp_table_schema_name for Snowflake.
Copy link

netlify bot commented Oct 25, 2024

👷 Deploy request for niobium-lead-7998 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3a482bb

@gx-cla-bot
Copy link

gx-cla-bot bot commented Oct 25, 2024

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: mathiasflorin

@@ -1266,6 +1266,7 @@ def get_batch_data_and_markers(
execution_engine=self,
selectable=selectable,
create_temp_table=create_temp_table,
temp_table_schema_name=temp_table_schema_name,
Copy link
Author

@mathiasflorin mathiasflorin Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sqlalchemy_batch_data.py code uses temp_table_schema_name variable in self._generate_selectable_from_selectable.
This method then calls _generate_selectable_from_selectable, passing temp_table_schema_name.

I am using Snowflake as the database engine. With this change, the _create_temporary_tablemethod allows me to create the temporary table in another schema.

I am using temp_table_schema_name with batch_spec_passthrough for the validations' batch request.

@mathiasflorin
Copy link
Author

@cla-bot check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants