-
Notifications
You must be signed in to change notification settings - Fork 6.7k
chore: migrate code from googleapis/python-db-dtypes-pandas #13776
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
Conversation
Migrated from BigQuery googleapis/python-bigquery#972
* docs: add how-to guide and include API reference * fix indentation * fix types in sample * fix types in sample
Source-Link: googleapis/synthtool@52aef91 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@4760d8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update setup.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Swast <[email protected]>
Source-Link: googleapis/synthtool@82f5cb2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
Source-Link: googleapis/synthtool@1b71c10 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * require python 3.7+ in setup.py * remove python 3.6 sample configs * update product documentation in .repo-metadata.json * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * exclude templated readme * require python 3.7+ in setup.py * remove python 3.6 from noxfile * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update README Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
Source-Link: googleapis/synthtool@50db768 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@6ed3a83 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@7197a00 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update dependency pytest to v7.2.1 * use python 3.11 in prerelease github action workflow * use python 3.11 in compliance github action workflow --------- Co-authored-by: Anthonios Partheniou <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(python): Add Python 3.12 Source-Link: googleapis/synthtool@af16e6d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5 * add constraints file for python 3.12 * remove constraints file for python 3.6 * Add trove classifiers for python 3.11 / 3.12 * update prerelease and compliance workflows to use python 3.12 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
Co-authored-by: Lingqing Gan <[email protected]>
* chore(deps): update all dependencies * updates to prevent changes to docs and lint.ymls * updates lint python version to 3.10 * remove comments, update lint python version * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update all dependencies * Update docs.yml * Update lint.yml --------- Co-authored-by: Lingqing Gan <[email protected]>
This PR adds Python 3.14 as a supported version, and fixed tests for the new version This PR also adds a dependency bound to pandas, as the [upcoming 3.0.0 version is incompatible](googleapis/python-db-dtypes-pandas#381)
Summary of ChangesHello @Linchin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces new sample code for BigQuery pandas date and time dtypes, along with its corresponding test file and necessary configuration updates. The changes are generally well-structured and functional, with minor suggestions regarding the robustness of the repository root detection in noxfile.py and the flexibility of dependency pinning in requirements-test.txt.
| # Get root of this repository. Assume we don't have directories nested deeper than 10 items. | ||
| p = Path(os.getcwd()) | ||
| for i in range(10): | ||
| if p is None: | ||
| break | ||
| if Path(p / ".git").exists(): | ||
| return str(p) | ||
| # .git is not available in repos cloned via Cloud Build | ||
| # setup.py is always in the library's root, so use that instead | ||
| # https://github.com/googleapis/synthtool/issues/792 | ||
| if Path(p / "setup.py").exists(): | ||
| return str(p) | ||
| p = p.parent | ||
| raise Exception("Unable to detect repository root.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _get_repo_root function uses an arbitrary limit of 10 parent directories to find the repository root. While this might be sufficient for most cases, it introduces a potential point of failure if the directory structure is deeper. A more robust approach would be to continue traversing parent directories until the root is definitively found or no more parent directories exist.
| # Get root of this repository. Assume we don't have directories nested deeper than 10 items. | |
| p = Path(os.getcwd()) | |
| for i in range(10): | |
| if p is None: | |
| break | |
| if Path(p / ".git").exists(): | |
| return str(p) | |
| # .git is not available in repos cloned via Cloud Build | |
| # setup.py is always in the library's root, so use that instead | |
| # https://github.com/googleapis/synthtool/issues/792 | |
| if Path(p / "setup.py").exists(): | |
| return str(p) | |
| p = p.parent | |
| raise Exception("Unable to detect repository root.") | |
| while p is not None: | |
| if Path(p / ".git").exists(): | |
| return str(p) | |
| # .git is not available in repos cloned via Cloud Build | |
| # setup.py is always in the library's root, so use that instead | |
| # https://github.com/googleapis/synthtool/issues/792 | |
| if Path(p / "setup.py").exists(): | |
| return str(p) | |
| p = p.parent |
| @@ -0,0 +1 @@ | |||
| pytest==8.4.2 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinning pytest to an exact patch version (8.4.2) can be overly restrictive. It's generally recommended to use a more flexible version specifier (e.g., pytest>=8.4.2,<9 or pytest~=8.4.2) to allow for minor bug fixes and security updates without requiring manual intervention, unless there's a specific compatibility issue that necessitates this exact pin.
pytest~=8.4.2
|
Just checking, but this is migrating the samples from the library repo over to the handwritten samples repo correct? |
|
as this is just a migration, going to accept and we can update in a later PR. |
timeanddatedtypesDescription
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)