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

ARROW-3094: [Python] Easier construction of schemas and struct types #2450

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Aug 20, 2018

Allow calling pa.schema() and pa.struct() with a list of tuples, or a mapping of strings to datatypes, instead of having to call pa.field() explicitly for each field. The latter is still possible if e.g. wanting to pass metadata.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

+1, very useful improvement! We may want to add this to the Sphinx docs

Allow calling pa.schema() and pa.struct() with a list of tuples,
or a mapping of strings to datatypes, instead of having to call
pa.field() explicitly for each field.
@pitrou pitrou force-pushed the ARROW-3094-easier-struct-schema-construction branch from 4b41370 to 4b27541 Compare August 21, 2018 14:51
@codecov-io
Copy link

Codecov Report

Merging #2450 into master will increase coverage by 1.28%.
The diff coverage is 95.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2450      +/-   ##
==========================================
+ Coverage   86.12%   87.41%   +1.28%     
==========================================
  Files         306      244      -62     
  Lines       46591    42960    -3631     
==========================================
- Hits        40126    37553    -2573     
+ Misses       6391     5407     -984     
+ Partials       74        0      -74
Impacted Files Coverage Δ
python/pyarrow/tests/test_types.py 100% <100%> (ø) ⬆️
python/pyarrow/tests/test_schema.py 100% <100%> (ø) ⬆️
python/pyarrow/types.pxi 58.47% <88.23%> (+0.6%) ⬆️
cpp/src/arrow/status.h 95.29% <0%> (ø) ⬆️
rust/src/bitmap.rs
go/arrow/memory/go_allocator.go
go/arrow/math/int64_avx2_amd64.go
go/arrow/datatype_numeric.gen.go
go/arrow/type_string.go
go/arrow/datatype_nested.go
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94e8196...4b27541. Read the comment docs.

@wesm wesm closed this in e8e82d0 Aug 21, 2018
@pitrou pitrou deleted the ARROW-3094-easier-struct-schema-construction branch August 21, 2018 15:57
stephanie-wang pushed a commit to stephanie-wang/arrow that referenced this pull request Aug 29, 2018
Allow calling `pa.schema()` and `pa.struct()` with a list of tuples, or a mapping of strings to datatypes, instead of having to call `pa.field()` explicitly for each field. The latter is still possible if e.g. wanting to pass metadata.

Author: Antoine Pitrou <antoine@python.org>

Closes apache#2450 from pitrou/ARROW-3094-easier-struct-schema-construction and squashes the following commits:

4b27541 <Antoine Pitrou> Use shorthand notation more often in docs
1215123 <Antoine Pitrou> Fix for Python 2.7
39a21df <Antoine Pitrou> ARROW-3094:  Easier construction of schemas and struct types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants