GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: removed pkg_resources from all test files and moved importlib into pandas extra by kiraksi · Pull Request #1726 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@kiraksi

@kiraksi kiraksi commented Nov 16, 2023 •
edited by parthea
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

In this PR

  • removed all instances of pkg_resources in tests and introduced importlib instead
  • similar to feat: introduce compatibility with native namespace packages python-bigquery-storage#706
  • should resolve any further issues we had stemming from pkg_resources

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #1725 🦕
Fixes #313 🦕

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Nov 16, 2023
@kiraksi kiraksi added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 16, 2023
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Nov 16, 2023
@kiraksi
kiraksi requested a review from parthea November 16, 2023 23:29
@kiraksi
kiraksi marked this pull request as ready for review November 16, 2023 23:29
@kiraksi
kiraksi requested review from a team and mrfaizal and removed request for mrfaizal November 16, 2023 23:29
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Nov 16, 2023
parthea
parthea reviewed Nov 17, 2023
View reviewed changes
Comment thread tests/system/test_pandas.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/unit/test__pandas_helpers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kiraksi
kiraksi requested a review from a team as a code owner November 20, 2023 22:41
@product-auto-label product-auto-label Bot added size: xl Pull request size is extra large. and removed size: m Pull request size is medium. labels Nov 20, 2023
@snippet-bot

snippet-bot Bot commented Nov 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parthea and others added 6 commits November 20, 2023 14:47
@parthea @kiraksi
feat: Introduce compatibility with native namespace packages
f5d3299
@parthea @kiraksi
Update copyright year
06d7a9a
@kiraksi
removed pkg_resources from all test files and moved importlib into pa…
34196e1
…ndas extra
@kiraksi
feat: removed pkg_resources from all test files and moved importlib i…
8d5396a
…nto pandas extra
@kiraksi
Adding no cover tag to test code
e905cbe
@kiraksi
reformatted with black
43e89a6
@kiraksi
kiraksi force-pushed the remove-pkgresources branch from 4cb86ab to 43e89a6 Compare November 20, 2023 22:47
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: xl Pull request size is extra large. labels Nov 20, 2023
@kiraksi
undo revert
bdbcdc9
parthea
parthea approved these changes Nov 21, 2023
View reviewed changes

@parthea parthea left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM. Added one observation for potentially unnecessary version checks in test files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/system/test_pandas.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@parthea parthea mentioned this pull request Nov 21, 2023
feat: Introduce compatibility with native namespace packages #1720
Closed
@kiraksi
removed minimum check
90fd53b
@kiraksi kiraksi added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 27, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 27, 2023
chalmerlowe
chalmerlowe approved these changes Nov 28, 2023
View reviewed changes

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/system/test_pandas.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/system/test_pandas.py
@pytest.mark.skipif(
PANDAS_INSTALLED_VERSION >= pkg_resources.parse_version("2.0.0"), reason=""
)
@pytest.mark.skipif(PANDAS_INSTALLED_VERSION[0:2] not in ["0.", "1."], reason="")

@chalmerlowe chalmerlowe Nov 28, 2023

Copy link
Copy Markdown
Collaborator

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.

This has several elements in the list so it is a bit easier to grok what is happening here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chalmerlowe chalmerlowe added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 28, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 28, 2023
parthea
parthea reviewed Nov 28, 2023
View reviewed changes
Comment thread tests/system/test_pandas.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kiraksi
updated pandas installed version check
c50eca3
@kiraksi
kiraksi force-pushed the remove-pkgresources branch from 0e8af65 to c50eca3 Compare November 28, 2023 21:07
@kiraksi
kiraksi merged commit 1f4ebb1 into googleapis:main Nov 28, 2023
@kiraksi
kiraksi deleted the remove-pkgresources branch November 28, 2023 21:47
@release-please release-please Bot mentioned this pull request Nov 22, 2023
chore(main): release 3.14.0 #1709
Merged
@tswast

tswast commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

This breaks BigQuery DataFrames e2e tests. Let's revert.

ImportError while importing test module '/tmpfs/src/github/python-bigquery-dataframes/tests/unit/ml/test_golden_sql.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/[usr/local/lib/python3.11/importlib/__init__.py:126](https://cs.corp.google.com/piper///depot/google3/usr/local/lib/python3.11/importlib/__init__.py?l=126): in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
[tests/unit/ml/test_golden_sql.py:17](https://cs.corp.google.com/piper///depot/google3/tests/unit/ml/test_golden_sql.py?l=17): in <module>
    from google.cloud import bigquery
E   ImportError: cannot import name 'bigquery' from 'google.cloud' (/tmpfs/src/github/python-bigquery-dataframes/.nox/unit_prerelease/src/google-cloud-bigquery-storage/google/cloud/__init__.py)

https://fusion2.corp.google.com/invocations/2be1e8d5-99f1-41aa-97e4-4cabb94bd441/targets/bigframes%2Fpresubmit%2Fe2e/log

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tswast added a commit that referenced this pull request Nov 28, 2023
@tswast
Revert "feat: removed pkg_resources from all test files and moved imp…
c2c5413
…ortlib into pandas extra (#1726)"

This reverts commit 1f4ebb1.
@tswast tswast mentioned this pull request Nov 28, 2023
Revert "feat: removed pkg_resources from all test files and moved importlib into pandas extra" #1739
Closed
@parthea

parthea commented Nov 28, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Good catch @tswast ! I can produce the issue when using an editable install using egg as it appears in the build log

When I install using an editable install using egg, the import fails

pip install -e git+https://github.com/googleapis/python-bigquery.git@1f4ebb1eca4f9380a31172fc8cb2fae125f8c5a2#egg=google_cloud_bigquery --ignore-installed

When I install without an editable install, the import succeeds

pip install https://github.com/googleapis/python-bigquery/archive/main.zip --ignore-installed

I can produce the same issue with the google-auth package. The import of google.auth fails when I use

pip install -e git+https://github.com/googleapis/google-auth-library-python.git@7ab0fced0008ad9283c955b7dd7e2b7db55ae5e7#egg=google_auth --ignore-installed`

but not with

pip install https://github.com/googleapis/google-auth-library-python/archive/main.zip

The change to move to native namespace packages was released in July for google-auth.

We should investigate whether we want to block on this issue before reverting the change as we do want to support python 3.12 without using pkg_resources.

We could also consider the change to move to native namespace packages as a potential breaking change and bump the major version.

If this only affects editable installs, IMO we should consider this a minor version instead of a major version bump as there are limitations for editable installations:
https://setuptools.pypa.io/en/latest/userguide/development_mode.html#limitations

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parthea parthea mentioned this pull request Nov 29, 2023
build: use standard install in prerelease nox session google/bigframes#238
Closed
@tswast

tswast commented Nov 29, 2023

Copy link
Copy Markdown
Contributor

Thanks for the investigation! I think we can remove the "-e" in the BigFrames tests.

parthea reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kiraksi
kiraksi restored the remove-pkgresources branch November 29, 2023 01:53
@kiraksi
kiraksi deleted the remove-pkgresources branch November 29, 2023 05:55
This was referenced Dec 5, 2023
December 04, 2023 kitta65/bq-extension-vscode#257
Closed
December 04, 2023 kitta65/prettier-plugin-bq#264
Closed
December 04, 2023 kitta65/bq2cst#274
Closed
This was referenced Dec 19, 2023
December 18, 2023 kitta65/bq-extension-vscode#262
Closed
December 18, 2023 kitta65/prettier-plugin-bq#269
Closed
December 18, 2023 kitta65/bq2cst#279
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@parthea parthea parthea approved these changes
@chalmerlowe chalmerlowe chalmerlowe approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Remove pkg_resource dependency after native namespace compatibility is implemented use native support for namespace packages

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@kiraksi @tswast @parthea @chalmerlowe @yoshi-kokoro
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.