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

GH-39277: [Python] Fix missing byte_width attribute on DataType class #39592

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

kevinmingtarja
Copy link
Contributor

@kevinmingtarja kevinmingtarja commented Jan 13, 2024

Rationale for this change

As mentioned in the issue, the byte_width attribute was missing on most data types, which is a small annoyance.

What changes are included in this PR?

Add the byte_width attribute on the DataType class (which is the base class of all Arrow data types), instead of on FixedSizeBinaryType (which is a child class of DataType).

Are these changes tested?

Yes, tests were added in python/pyarrow/tests/test_types.py.

Are there any user-facing changes?

Yes, users can now access the byte_width attribute on all fixed width data types.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Jan 13, 2024
@kevinmingtarja kevinmingtarja force-pushed the GH-39277-missing-byte-width branch from d80c403 to 5da332c Compare February 28, 2024 09:02
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks for the update @kevinmingtarja . This LGTM, I'll merge if CI passes successfully.

@pitrou pitrou merged commit 655ae96 into apache:main Feb 28, 2024
14 checks passed
@pitrou pitrou removed the awaiting merge Awaiting merge label Feb 28, 2024
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Feb 28, 2024
… class (apache#39592)

### Rationale for this change

As mentioned in the issue, the byte_width attribute was missing on most data types, which is a small annoyance.

### What changes are included in this PR?

Add the byte_width attribute on the DataType class (which is the base class of all Arrow data types), instead of on FixedSizeBinaryType (which is a child class of DataType).

### Are these changes tested?

Yes, tests were added in `python/pyarrow/tests/test_types.py`.

### Are there any user-facing changes?

Yes, users can now access the byte_width attribute on all fixed width data types.

* Closes: apache#39277

Authored-by: Kevin Mingtarja <kevin.mingtarja@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Copy link

After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 655ae96.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 7 possible false positives for unstable benchmarks that are known to sometimes produce them.

pitrou pushed a commit that referenced this pull request Mar 7, 2024
#40381)

### Rationale for this change

Fixing the hypothesis tests:

- fixup untested changes to the strategies from #40160
- fix a bug in the `byte_width` attribute discovered by hypothesis (introduced by #39592)

* GitHub Issue: #40379

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
… class (apache#39592)

### Rationale for this change

As mentioned in the issue, the byte_width attribute was missing on most data types, which is a small annoyance.

### What changes are included in this PR?

Add the byte_width attribute on the DataType class (which is the base class of all Arrow data types), instead of on FixedSizeBinaryType (which is a child class of DataType).

### Are these changes tested?

Yes, tests were added in `python/pyarrow/tests/test_types.py`.

### Are there any user-facing changes?

Yes, users can now access the byte_width attribute on all fixed width data types.

* Closes: apache#39277

Authored-by: Kevin Mingtarja <kevin.mingtarja@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
…s tests (apache#40381)

### Rationale for this change

Fixing the hypothesis tests:

- fixup untested changes to the strategies from apache#40160
- fix a bug in the `byte_width` attribute discovered by hypothesis (introduced by apache#39592)

* GitHub Issue: apache#40379

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python] Missing byte_width attribute on most datatypes
3 participants