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

docs: update bigframes.pandas.Index docstrings #1144

Merged
merged 21 commits into from
Nov 27, 2024

Conversation

arwas11
Copy link
Contributor

@arwas11 arwas11 commented Nov 11, 2024

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)
    • values: screen/4ViVk2h34LfgD9r
    • shape: screen/3Ld4EGsxTfmZnVh
    • nlevels: screen/6TYw5qPWkzpKFq7
    • is_unique: screen/7grdQKsxVLv6mGs
    • has_duplicates: screen/7CQgVfVsiNtkqXw
    • dtype: screen/ 75HzCFFRdPbJVCn
    • dtypes: screen/6i8zVhpfksEdzVR
    • T: screen/9ZuShN6bfoWvKxn
    • copy: screen/8pMYrfDSaLqcdQM
    • astype: screen/8AsiSd6DvjszHkQ, screen/
    • get_level_values: screen/
    • to_series: screen/, screen/
    • isin: screen/3G6UfR5fTocREdn, screen/86tTDdCKnSWdVZx
    • all: screen/8w3maL5nEkp9Jko, screen/AT9SB55jdUkwViC
    • any: screen/6zbST5graLENBcX
    • min: screen/c38rufXA7pdZq22
    • max: screen/8RpYJJTBCcgZZ3x
    • argmin: screen/7CqEuNjhjibmXJE, screen/5D67hEv7okLXhVG
    • argmax: screen/4ojQtUpLqEW2qDE, screen/6i63mdEUgFaVArH
    • nunique: screen/ 4zAMoEvxFGLQ2vT
    • sort_values: screen/5nsxukvUq5raPHe, screen/AcviuSvz4m5fuTs
    • value_counts: screen/AMh3QtVxLVBhPDT, screen/SKjbGAzjEZhAswS, screen,/ByGcJANuAiJkZjK
    • fillna: screen/4f7nZJRqBZ3Vyb2
    • rename: screen/4zvSA3knkh6stpB
    • drop: screen/7dTVqr9DAEtBUsQ
    • dropna: screen/5cxdPbQjSq8WHiy
    • drop_duplicates: screen/BkKbQXgvZRPfEbN, screen/3ggJqu9RQj6BqFY

Fixes #296390934 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Nov 11, 2024
@arwas11 arwas11 force-pushed the b296390934-docstrings-type-annotation-index branch from f3a0332 to 1871ed2 Compare November 12, 2024 19:00
@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 21, 2024
@arwas11 arwas11 changed the title docs: update bigframes.pandas.Index docstrings docs: update bigframes.pandas.Index docstrings Nov 21, 2024
@arwas11 arwas11 marked this pull request as ready for review November 22, 2024 22:04
@arwas11 arwas11 requested review from a team as code owners November 22, 2024 22:04
@arwas11 arwas11 requested a review from shuoweil November 22, 2024 22:04
@arwas11 arwas11 requested a review from tswast November 22, 2024 22:04
@@ -134,7 +134,6 @@ def name(self, value: blocks.Label):

@property
def names(self) -> typing.Sequence[blocks.Label]:
"""Returns the names of the Index."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

For context for Huan, these are borrowed from pandas, so need to come from third_party.

Copy link
Collaborator

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Love it! The examples make me happy.

@tswast tswast self-requested a review November 22, 2024 22:13
@tswast
Copy link
Collaborator

tswast commented Nov 22, 2024

Please make sure doctest passes before merging.

@tswast
Copy link
Collaborator

tswast commented Nov 25, 2024

We're still getting quite a few doctest failures. Please fix.

FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.all
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.any
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.nlevels
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.argmax
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.argmin
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.nunique
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.dropna
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.has_duplicates
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.isin
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.max
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.min
FAILED third_party/bigframes_vendored/pandas/core/indexes/base.py::indexes.base.Index.name

Comment on lines 446 to 447
>>> bpd.Index([1, 2, 3]).all()
True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, pandas gives a numpy object in some versions. It should be interchangeable with a bool, but it has a different repr. Try this (here and in other failing tests):

Suggested change
>>> bpd.Index([1, 2, 3]).all()
True
>>> bool(bpd.Index([1, 2, 3]).all())
True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I'll give it a try.

@tswast tswast merged commit 557ab8d into main Nov 27, 2024
23 checks passed
@tswast tswast deleted the b296390934-docstrings-type-annotation-index branch November 27, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants