Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR releases v0.3.0 by modernizing packaging/tooling (Poetry → uv + Hatchling), adding a Google Cloud Storage connector with tests, and introducing a CSV → database batching script intended for loading data into BigQuery (and other connectors).
Changes:
- Migrate packaging to PEP 621
[project]metadata + Hatchling build backend; update CI/Makefile/pre-commit to useuv, ruff-format, mypy, pytest. - Add
CloudStorageConnector(GCS) plus unit tests. - Add
stream_csv_to_databasescript and tests for batched CSV uploads.
Reviewed changes
Copilot reviewed 21 out of 26 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Moves to PEP 621 metadata + Hatchling; defines deps, ruff/mypy/pytest config. |
poetry.lock |
Removed as part of Poetry → uv migration. |
uv.lock |
New lockfile to support uv sync in CI (existing file in repo). |
Makefile |
Adds uv-based ruff/pytest/mypy targets. |
.pre-commit-config.yaml |
Updates ruff hook version and adds ruff-format. |
.github/workflows/pr_checks.yml |
New PR CI jobs using uv (ruff, format, mypy, pytest). |
.github/workflows/publish.yml |
New PyPI publish workflow (currently broken; see comments). |
.github/workflows/automated_tests.yml |
Removes legacy Poetry-based CI workflow. |
klondike/base/abc_klondike.py |
Renames/expands ABCs into database vs storage connector interfaces. |
klondike/gcp/cloud_storage.py |
Implements CloudStorageConnector (list/get/put blobs, list buckets). |
tests/gcp/test_cloud_storage.py |
Adds unit tests for CloudStorageConnector behaviors. |
klondike/scripts/stream_csv_to_database.py |
Adds CSV batching uploader script (currently not truly streaming; see comments). |
klondike/scripts/__init__.py |
Exposes stream_csv_to_database. |
tests/scripts/test_stream_csv_to_bigquery.py |
Adds tests around the CSV batching script. |
klondike/gcp/bigquery.py |
Refactors BigQueryConnector typing/base class and query return behavior. |
klondike/snowflake/snowflake.py |
Refactors SnowflakeConnector typing/base class; adds kwargs plumbing and result normalization. |
klondike/utilities/utilities.py |
Adds get_env_or_value; improves typing/docstrings. |
klondike/utilities/logger.py |
Introduces shared colored logger implementation. |
klondike/__init__.py |
Switches to shared logger and dynamic exports (contains a broken export; see comments). |
klondike/aws/redshift.py |
Updates base class name to KlondikeBaseDatabaseConnector. |
klondike/aws/s3.py |
Updates base class name to KlondikeBaseStorageConnector. |
klondike/postgres/postgres.py |
Updates base class name to KlondikeBaseDatabaseConnector. |
README.md |
Updates intro and adds logo. |
.gitignore |
Adds development/. |
Comments suppressed due to low confidence (1)
klondike/gcp/bigquery.py:133
__setup_google_app_credsis broken for dict credentials: it writes JSON to aTemporaryFile(which typically has no usable filesystem path) and then sets the env var to the JSON string (creds), not to a filename.GOOGLE_APPLICATION_CREDENTIALSmust point to a JSON file path. UseNamedTemporaryFile(delete=False)(or similar), write the JSON there, and set the env var to that file path (and ensure the temp file lifecycle is handled).
def __setup_google_app_creds(
self, app_creds: Union[str, dict[str, Any]], env_variable: str
) -> None:
"Sets runtime environment variable for Google SDK"
if isinstance(app_creds, dict):
creds = json.dumps(app_creds)
tempp_file = tempfile.TemporaryFile(suffix=".json")
with open(tempp_file.name, "w") as f:
f.write(creds)
elif isinstance(app_creds, str):
creds = app_creds
os.environ[env_variable] = creds
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GoogleCloudStorageobject (including unit tests)