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

chore(ibis): introduce a script for query locally #869

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

goldmedal
Copy link
Contributor

Description

This PR implements a simple Python script to execute an SQL locally. Currently, only implement the BigQuery connection in this PR.
Given the required environment variables, we can input an SQL file like

poetry run python tools/query_local_run.py < test.sql

@github-actions github-actions bot added documentation Improvements or additions to documentation ibis python Pull requests that update Python code labels Oct 31, 2024
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

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

How about using an env var WREN_CONFIG_ROOT and using fixed file names like manifest.json, function_list, connection_info.json?

@goldmedal
Copy link
Contributor Author

How about using an env var WREN_CONFIG_ROOT and using fixed file names like manifest.json, function_list, connection_info.json?

In my use case, I won't put them in the same folder. I could get the manifest from another project and the function list from the ibis resource. I think it's more flexible.

@goldmedal
Copy link
Contributor Author

goldmedal commented Oct 31, 2024

Because I also use dotenv in this script, the user can maintain all of them in the .env file.

@grieve54706
Copy link
Contributor

How about a config.properties file to collect these variables? There are too many environment variables for me now.

@goldmedal
Copy link
Contributor Author

How about a config.properties file to collect these variables? There are too many environment variables for me now.

hmm.. I think it is just a script for testing locally, not for production. I don't prefer to have an additional config file for it. Why not just use .env file to maintain them?

@grieve54706
Copy link
Contributor

Oh! cool. The .env is fine to me. I didn't catch that you meant that before.

@grieve54706 grieve54706 merged commit 30c28dd into Canner:main Oct 31, 2024
4 checks passed
@goldmedal goldmedal deleted the chore/local-run branch October 31, 2024 03:47
@goldmedal
Copy link
Contributor Author

Thanks @grieve54706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ibis python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants