Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

docs: update bigframes.pandas.Index docstrings#1144

Merged
tswast merged 21 commits intomainfrom
b296390934-docstrings-type-annotation-index
Nov 27, 2024
Merged

docs: update bigframes.pandas.Index docstrings#1144
tswast merged 21 commits intomainfrom
b296390934-docstrings-type-annotation-index

Conversation

@arwas11
Copy link
Copy Markdown
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 and shuoweil November 22, 2024 22:04
@arwas11 arwas11 requested a review from tswast November 22, 2024 22:04

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

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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

tswast commented Nov 22, 2024

Please make sure doctest passes before merging.

Comment thread third_party/bigframes_vendored/pandas/core/indexes/base.py Outdated
@tswast
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
@tswast tswast deleted the b296390934-docstrings-type-annotation-index branch November 27, 2024 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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