-
Notifications
You must be signed in to change notification settings - Fork 4.2k
WIP: [Docs] Update extension type examples to not use UUID #43849
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
130 commits
Select commit
Hold shift + click to select a range
4db2ca0
UuidType -> RationalType in the docs
khwilson 4d95f22
fix json formatting
khwilson fde3215
fix some typos
khwilson d875d2c
Update docs/source/python/extending_types.rst
khwilson eb69055
Update docs/source/python/extending_types.rst
khwilson 3fc6842
response to ianmcook
khwilson 0e051ea
define parameters
khwilson 8614fd5
Update python/pyarrow/types.pxi
khwilson 03b3fd9
Update docs/source/python/extending_types.rst
khwilson 2abdcb8
more edits
khwilson 4c66e4d
missed one formatting
khwilson 253156b
import pyarrow in doctests examples
khwilson da6cdf2
import pyarrow in more doctests examples
khwilson d31d59b
MINOR: [Java] Bump dep.slf4j.version from 2.0.13 to 2.0.16 in /java (…
dependabot[bot] 8855c59
MINOR: [R] Add missing PR num to news.md item (#43811)
amoeba 7bc2e01
MINOR: [Java] Bump dep.junit.jupiter.version from 5.10.3 to 5.11.0 in…
dependabot[bot] 20f8357
GH-15058: [C++][Python] Native support for UUID (#37298)
rok 95bce2e
MINOR: [Go] Bump github.com/hamba/avro/v2 from 2.24.1 to 2.25.0 in /g…
dependabot[bot] e8912c9
GH-43667: [Java] Keeping Flight default header size consistent betwee…
PANKAJ9768 aa8950f
MINOR: [Go] Bump github.com/substrait-io/substrait-go from 0.6.0 to 0…
dependabot[bot] db0029f
MINOR: [Java] Downgrade gRPC to 1.65 (#43839)
lidavidm 5b98125
MINOR: [Java] Bump org.apache.commons:commons-compress from 1.27.0 to…
dependabot[bot] ca4c756
MINOR: [C#] Bump Microsoft.NET.Test.Sdk from 17.10.0 to 17.11.0 in /c…
dependabot[bot] 909ae17
GH-41056: [GLib][FlightRPC] Add gaflight_client_do_put() and related …
kou ef33625
GH-43815: [CI][Packaging][Python] Avoid uploading wheel to gemfury if…
raulcd ab38581
GH-43790: [Go][Parquet] Add support for LZ4_RAW compression codec (#4…
joellubi 581a6db
MINOR: [CI] Use `docker compose` on self-hosted ARM builds (#43844)
pitrou 5dcd5eb
GH-43805: [C++] Enable filesystem automatically when one of ARROW_{AZ…
kou fd3df37
MINOR: [Java] Logback dependency upgrade (#43842)
vibhatha 18a8670
MINOR: [Java] Bump commons-cli:commons-cli from 1.8.0 to 1.9.0 in /ja…
dependabot[bot] a48f69b
MINOR: [Java] Bump com.google.api.grpc:proto-google-common-protos fro…
dependabot[bot] 2fc8423
GH-43860: [Go][Parquet] Handle the error correctly (#43861)
bigsheeper 4b9434e
GH-43854: [C++] Expose the set of device types where a ChunkedArray i…
felipecrv f460bcf
GH-38183: [CI][Python] Use pipx to install GCS testbench (#43852)
pitrou 97d5b25
GH-43877: [Ruby] Add support for 0 decimal value (#43882)
kou ac4a714
GH-43870: [C++][Acero] Fix typos in join benchmark (#43871)
zanmato1984 4a7a421
GH-41696: [Python][Packaging] Bump MACOSX_DEPLOYMENT_TARGET to 12 ins…
raulcd 962f98e
GH-43732: [Go] Require Go 1.22 or above (#43864)
haoxins 8a79889
GH-43759: [C++] Acero: Minor code enhancement for Join (#43760)
mapleFU 3446117
GH-43885: [C++][CI] Catch potential integer overflow in PoolBuffer (#…
pitrou b6c2237
GH-43869: [Java][CI] Flight related failure in the AMD64 Windows Serv…
vibhatha 37d54cb
GH-43837: [Go][IPC] Consolidate StreamWriter and FileWriter, ensuring…
joellubi 9ef2e74
MINOR: [JS] Bump @swc/helpers from 0.5.11 to 0.5.12 in /js (#43901)
dependabot[bot] 1679f3c
GH-43665: [R] Remove references to bindings vignette (#43889)
nealrichardson 373de67
MINOR: [JS] Bump ix from 6.0.0 to 7.0.0 in /js (#43898)
dependabot[bot] aa006c3
MINOR: [JS] Bump @typescript-eslint/eslint-plugin from 7.12.0 to 7.18…
dependabot[bot] 576c8cc
MINOR: [R] Fix monospace formatting in dplyr-funcs-doc (#43461)
feinleib 37909ba
GH-43894: [R] format_aggregation() should print options too (#43896)
nealrichardson 732b104
GH-25118: [Python] Make NumPy an optional runtime dependency (#41904)
raulcd a16021a
GH-43758: [C++] Compute: More comment in RowEncoder (#43763)
mapleFU 9ed05af
GH-43768: [C++] Fix the case when boolean_{any|all} meets constant in…
mapleFU 7ed01ee
GH-43883: [CI] Remove Python version guard when installing GCS testbe…
pitrou 319a37f
MINOR: [C#] Bump Grpc.Tools from 2.65.0 to 2.66.0 in /csharp (#43913)
dependabot[bot] 4103604
MINOR: [C#] Bump Google.Protobuf from 3.27.3 to 3.28.0 in /csharp (#4…
dependabot[bot] d5b873a
GH-40216: [CI][Packaging][Python] Upload pyarrow nightly wheels to sc…
raulcd 2c502aa
GH-43746: [C++] Add support for Boost 1.86 (#43766)
kou 11bee6e
MINOR: [CI] Bump actions/setup-python from 5.1.1 to 5.2.0 (#43917)
dependabot[bot] 6111912
GH-43797: [C++] Attach `arrow::ArrayStatistics` to `arrow::ArrayData`…
kou 4ee3f3a
MINOR: [Java] Bump org.mockito:mockito-junit-jupiter from 5.12.0 to 5…
dependabot[bot] 6b7ed7a
MINOR: [Java] Bump com.github.luben:zstd-jni from 1.5.6-4 to 1.5.6-5 …
dependabot[bot] 6686afa
MINOR: [Java] Bump org.apache.orc:orc-core from 1.9.2 to 1.9.4 in /ja…
dependabot[bot] 9657077
MINOR: [Java] Bump parquet.version from 1.14.1 to 1.14.2 in /java (#4…
dependabot[bot] 34eaeb5
MINOR: [Java] Bump error_prone_core.version from 2.30.0 to 2.31.0 in …
dependabot[bot] 4050087
GH-40216: [Python][CI][Packaging] Upload nightly wheels to main label…
jorisvandenbossche 908b509
GH-43907: [C#][FlightRPC] Add Grpc Call Options support on Flight Cli…
qmmk 22f16df
GH-43927: [C++] Make ChunkResolver::ResolveMany output a list of Chun…
felipecrv f4d3c56
GH-43719: [C++] Clarify the way SIMD-enabled agg kernels come from th…
felipecrv 3ac2a29
GH-43933: [CI] Remove docker-compose warnings (#43934)
lysnikolaou b50ad30
GH-43902: [Java] Support for Long memory addresses (#43903)
vibhatha 96b91c2
GH-43727: [Python] RecordBatch fails gracefully on non-cpu devices (#…
danepitkin ab6ddac
GH-40216: [Python][CI][Packaging] Don't upload sdist to scientific-py…
jorisvandenbossche bb646a3
GH-43669: [Docs][Dev] Document archery --debug flag in section about …
jorisvandenbossche 63d3992
GH-43672: [C#] Schema should be optional on FlightInfo (#43673)
ndglover 02c2c8a
GH-43728: [Python] ChunkedArray fails gracefully on non-cpu devices (…
danepitkin 3ff350b
GH-38255: [Java] Implement Flight SQL Bulk Ingestion (#43551)
eramitmittal f6c58ec
GH-43952: [CI] Bump actions/{upload|download}-artifact from 3 to late…
dependabot[bot] caa368e
GH-43299: [Release][Packaging] Only include pyarrow folder when find…
raulcd 790f892
GH-43967: [C++] Enhance error message for URI parsing (#43938)
crystalxyz 981b841
GH-43946: [C++][Parquet] Guard against use of cleared decryptor/encry…
pitrou 97172b6
GH-43969: [CI][Dev] Prune .dockerignore (#43971)
pitrou 0b4066f
GH-40154: [C++][Parquet] Separate encoders and decoder (#43972)
pitrou f8d2f8f
MINOR: [CI][C++] Add C++ example builds to "cpp" Crossbow task group …
pitrou a95e612
GH-43944: [C++][Parquet] Add support for arrow::ArrayStatistics: non …
kou efb1551
GH-43796: [C++] Indent preprocessor directives (#43798)
kou 9489c10
MINOR: [Java] Bump com.puppycrawl.tools:checkstyle from 10.17.0 to 10…
vibhatha b7959c1
GH-43979: [CI][C++][Dev] Add cpplint to pre-commit (#43982)
kou 319efc3
GH-43712: [C++][Parquet] Dataset: Handle num-nulls in Parquet correct…
mapleFU df4d396
GH-43992: [C++] Add missing std::move() in array_nested.cc (#43993)
mapleFU e073859
GH-43814: [GLib][FlightRPC] Add `GAFlightServerClass::do_put` (#43999)
kou 6b17f49
GH-43983: [C++][Parquet] Add support for arrow::ArrayStatistics: zero…
kou 5ca26d7
GH-40860: [GLib][Parquet] Add `gparquet_arrow_file_writer_write_recor…
kou 38b3770
GH-43966: [Java] Check for nullabilities when comparing StructVector …
hellishfire 55130fa
GH-43986: [C++][Acero] Some code cleanup to `Grouper` (#43988)
zanmato1984 41d66d8
GH-43301: [C++][Parquet] Enhance the comment for ColumnReader/Decoder…
mapleFU 5db9d64
GH-43536: [Python][CI] Add a Crossbow job with the free-threaded buil…
lysnikolaou 1a949a1
MINOR: [CI] Bump actions/download-artifact from 4.1.7 to 4.1.8 (#44020)
dependabot[bot] cc5f90a
GH-44013: [Java] Consider warnings as errors for Dataset Module (#44014)
vibhatha e6e8585
GH-44011: [Java] Consider warnings as errors for C Module (#44012)
vibhatha 8508c76
GH-43576: [Java] Gandiva Tests are failing due to linking issues (#43…
vibhatha ab90f74
GH-44036: [C++] IPC: ipc reader/writer code enhancement (#44019)
mapleFU 6561bc0
GH-43996: [Java] Mark new allocated ArrowSchema as released (#43997)
viirya 3f63b20
MINOR: [C#] Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1 in /c…
dependabot[bot] 3fb6e58
GH-44016: [Java] Consider warnings as errors for Format Module (#44017)
vibhatha 3fe07d6
MINOR: [Java] Bump logback.version from 1.5.7 to 1.5.8 in /java (#44023)
dependabot[bot] 8da5134
MINOR: [Java] Bump io.netty:netty-bom from 4.1.112.Final to 4.1.113.F…
dependabot[bot] 9a36873
GH-43187: [C++] Support basic is_in predicate simplification (#43761)
larry98 b28d202
GH-43956: [Format] Allow Decimal32/Decimal64 in format (#43976)
zeroshade b1cf8b6
MINOR: [Java] Bump com.google.guava:guava-bom from 33.2.1-jre to 33.3…
dependabot[bot] 2fc9dc1
MINOR: [Java] Bump checker.framework.version from 3.46.0 to 3.47.0 in…
dependabot[bot] d658f64
MINOR: [CI][C++] Enable core dumps and stack traces in Linux/macOS jo…
pitrou 395ce07
GH-44044: [Java] Consider warnings as errors for Vector Module (#44045)
vibhatha 0a4d5c1
GH-43962: [Java] Consider warnings as errors for Adapter Module (#43963)
vibhatha c53f430
GH-44006: [GLib][Parquet] Add `gparquet_arrow_file_writer_new_row_gro…
kou e4a6f1e
GH-44050: [CI][Integration] Execute integration test again (#44051)
kou 8d5a775
GH-43973: [Python] Table fails gracefully on non-cpu devices (#43974)
danepitkin d4b38fd
GH-32538: [C++][Parquet] Add JSON canonical extension type (#13901)
zogger-dev 89c08a4
GH-36412: [Python][CI] Fix deprecation warning about day freq alias w…
jorisvandenbossche 7c6c42d
MINOR: [Java] Bump com.gradle:common-custom-user-data-maven-extension…
dependabot[bot] 837a3e2
GH-43748: [R] Handle package_version in safe_r_metadata (#43895)
nealrichardson 0f9ed84
GH-44063: [Python] Deprecate the no longer used serialize/deserialize…
jorisvandenbossche 002b301
GH-44072: [C++][Parquet] Add Float16 reading benchmarks (#44073)
pitrou a76ab32
GH-44081: [C++][Parquet] Fix reported metrics in parquet-arrow-reader…
pitrou 5fd9d74
GH-44076: [CI] Remove verify-rc-binaries-wheel-macos-11 which is now …
raulcd 1fe30d3
GH-44046: [Python] Fix threading issues with borrowed refs and pandas…
lysnikolaou d2dd352
MINOR: [CI] Bump actions/{download,upload}-artifact version (#44086)
pitrou ed8585e
GH-43840: [CI] Add cuda group to tasks.yml and minor updates for new …
raulcd a6b718e
GH-42247: [C++] Support casting to and from utf8_view/binary_view (#4…
felipecrv bd8866a
GH-44079: [C++][Parquet] Remove deprecated APIs (#44080)
pitrou 5779318
MINOR: [Docs] Remove mention of JIRA issues in the contributing PR ch…
jorisvandenbossche 0940ae8
fix spacing and version issues
khwilson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1618,59 +1618,79 @@ cdef class ExtensionType(BaseExtensionType): | |
|
|
||
| Examples | ||
| -------- | ||
| Define a UuidType extension type subclassing ExtensionType: | ||
| Define a RationalType extension type subclassing ExtensionType: | ||
|
|
||
| >>> import pyarrow as pa | ||
| >>> class UuidType(pa.ExtensionType): | ||
| ... def __init__(self): | ||
| ... pa.ExtensionType.__init__(self, pa.binary(16), "my_package.uuid") | ||
| ... def __arrow_ext_serialize__(self): | ||
| ... # since we don't have a parameterized type, we don't need extra | ||
| ... # metadata to be deserialized | ||
| ... return b'' | ||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata. | ||
| ... return UuidType() | ||
| ... | ||
| >>> import pyarrow.types as pt | ||
| >>> class RationalType(pa.ExtensionType): | ||
| ... def __init__(self, data_type: pa.DataType): | ||
| ... if not pt.is_integer(data_type): | ||
| ... raise TypeError(f"data_type must be an integer type not {data_type}") | ||
| ... super().__init__( | ||
| ... pa.struct( | ||
| ... [ | ||
| ... ("numer", data_type), | ||
| ... ("denom", data_type), | ||
| ... ], | ||
| ... ), | ||
| ... # N.B. This name does _not_ reference `data_type` so deserialization | ||
| ... # will work for _any_ integer `data_type` after registration | ||
| ... "my_package.rational", | ||
| ... ) | ||
| ... def __arrow_ext_serialize__(self) -> bytes: | ||
| ... # No serialized metadata necessary | ||
| ... return b"" | ||
|
ianmcook marked this conversation as resolved.
Outdated
|
||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata | ||
| ... return RationalType(storage_type[0].type) | ||
|
|
||
| Register the extension type: | ||
|
|
||
| >>> pa.register_extension_type(UuidType()) | ||
| >>> pa.register_extension_type(RationalType(pa.int64())) | ||
|
|
||
| Create an instance of UuidType extension type: | ||
| Create an instance of RationalType extension type: | ||
|
|
||
| >>> uuid_type = UuidType() | ||
| >>> rational_type = RationalType(pa.int32()) | ||
|
|
||
| Inspect the extension type: | ||
|
|
||
| >>> uuid_type.extension_name | ||
| 'my_package.uuid' | ||
| >>> uuid_type.storage_type | ||
| FixedSizeBinaryType(fixed_size_binary[16]) | ||
| >>> rational_type.extension_name | ||
| 'my_package.rational' | ||
| >>> rational_type.storage_type | ||
| StructType(struct<numer: int32, denom: int32>) | ||
|
|
||
| Wrap an array as an extension array: | ||
|
|
||
| >>> import uuid | ||
| >>> storage_array = pa.array([uuid.uuid4().bytes for _ in range(4)], pa.binary(16)) | ||
| >>> uuid_type.wrap_array(storage_array) | ||
| >>> storage_array = pa.array( | ||
| ... [ | ||
| ... {"numer": 10, "denom": 17}, | ||
| ... {"numer": 20, "denom": 13}, | ||
| ... ], | ||
| ... type=rational_type.storage_type | ||
| ... ) | ||
| >>> ratoinal_type.wrap_array(storage_array) | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| <pyarrow.lib.ExtensionArray object at ...> | ||
| [ | ||
| -- is_valid: all not null | ||
| ... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this failure is happening because this shows the ellipsis instead of the full output: https://github.com/apache/arrow/actions/runs/10762310741/job/29849821115?pr=43849#step:6:9145 |
||
| ] | ||
|
|
||
| Or do the same with creating an ExtensionArray: | ||
|
|
||
| >>> pa.ExtensionArray.from_storage(uuid_type, storage_array) | ||
| >>> pa.ExtensionArray.from_storage(rational_type, storage_array) | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| <pyarrow.lib.ExtensionArray object at ...> | ||
| [ | ||
| -- is_valid: all not null | ||
| ... | ||
| ] | ||
|
|
||
| Unregister the extension type: | ||
|
|
||
| >>> pa.unregister_extension_type("my_package.uuid") | ||
| >>> pa.unregister_extension_type("my_package.rational") | ||
|
|
||
| Note that even though we registered the concrete type | ||
| ``RationalType(pa.int64())``, pyarrow will be able to deserialize | ||
| ``RationalType(integer_type)`` for any ``integer_type`` as the deserializer | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| will reference the name ``my_package.rational`` and the ``@classmethod`` | ||
| ``__arrow_ext_deserialize__``. | ||
| """ | ||
|
|
||
| def __cinit__(self): | ||
|
|
@@ -2039,30 +2059,41 @@ def register_extension_type(ext_type): | |
|
|
||
| Examples | ||
| -------- | ||
| Define a UuidType extension type subclassing ExtensionType: | ||
| Define a RationalType extension type subclassing ExtensionType: | ||
|
|
||
| >>> import pyarrow as pa | ||
| >>> class UuidType(pa.ExtensionType): | ||
| ... def __init__(self): | ||
| ... pa.ExtensionType.__init__(self, pa.binary(16), "my_package.uuid") | ||
| ... def __arrow_ext_serialize__(self): | ||
| ... # since we don't have a parameterized type, we don't need extra | ||
| ... # metadata to be deserialized | ||
| ... return b'' | ||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata. | ||
| ... return UuidType() | ||
| ... | ||
| >>> import pyarrow.types as pt | ||
| >>> class RationalType(pa.ExtensionType): | ||
| ... def __init__(self, data_type: pa.DataType): | ||
| ... if not pt.is_integer(data_type): | ||
| ... raise TypeError(f"data_type must be an integer type not {data_type}") | ||
| ... super().__init__( | ||
| ... pa.struct( | ||
| ... [ | ||
| ... ("numer", data_type), | ||
| ... ("denom", data_type), | ||
| ... ], | ||
| ... ), | ||
| ... # N.B. This name does _not_ reference `data_type` so deserialization | ||
| ... # will work for _any_ integer `data_type` after registration | ||
| ... "my_package.rational", | ||
| ... ) | ||
| ... def __arrow_ext_serialize__(self) -> bytes: | ||
| ... # No serialized metadata necessary | ||
| ... return b"" | ||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata | ||
| ... return RationalType(storage_type[0].type) | ||
|
|
||
| Register the extension type: | ||
|
|
||
| >>> pa.register_extension_type(UuidType()) | ||
| >>> pa.register_extension_type(RationalType(pa.int64())) | ||
|
|
||
| Unregister the extension type: | ||
|
|
||
| >>> pa.unregister_extension_type("my_package.uuid") | ||
| >>> pa.unregister_extension_type("my_package.rational") | ||
| """ | ||
| cdef: | ||
| DataType _type = ensure_type(ext_type, allow_none=False) | ||
|
|
@@ -2089,30 +2120,41 @@ def unregister_extension_type(type_name): | |
|
|
||
| Examples | ||
| -------- | ||
| Define a UuidType extension type subclassing ExtensionType: | ||
| Define a RationalType extension type subclassing ExtensionType: | ||
|
|
||
| >>> import pyarrow as pa | ||
| >>> class UuidType(pa.ExtensionType): | ||
| ... def __init__(self): | ||
| ... pa.ExtensionType.__init__(self, pa.binary(16), "my_package.uuid") | ||
| ... def __arrow_ext_serialize__(self): | ||
| ... # since we don't have a parameterized type, we don't need extra | ||
| ... # metadata to be deserialized | ||
| ... return b'' | ||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata. | ||
| ... return UuidType() | ||
| ... | ||
| >>> import pyarrow.types as pt | ||
| >>> class RationalType(pa.ExtensionType): | ||
| ... def __init__(self, data_type: pa.DataType): | ||
| ... if not pt.is_integer(data_type): | ||
| ... raise TypeError(f"data_type must be an integer type not {data_type}") | ||
| ... super().__init__( | ||
| ... pa.struct( | ||
| ... [ | ||
| ... ("numer", data_type), | ||
| ... ("denom", data_type), | ||
| ... ], | ||
| ... ), | ||
| ... # N.B. This name does _not_ reference `data_type` so deserialization | ||
| ... # will work for _any_ integer `data_type` after registration | ||
| ... "my_package.rational", | ||
| ... ) | ||
| ... def __arrow_ext_serialize__(self) -> bytes: | ||
| ... # No serialized metadata necessary | ||
| ... return b"" | ||
| ... @classmethod | ||
| ... def __arrow_ext_deserialize__(self, storage_type, serialized): | ||
|
khwilson marked this conversation as resolved.
Outdated
|
||
| ... # return an instance of this subclass given the serialized | ||
| ... # metadata | ||
| ... return RationalType(storage_type[0].type) | ||
|
|
||
| Register the extension type: | ||
|
|
||
| >>> pa.register_extension_type(UuidType()) | ||
| >>> pa.register_extension_type(RationalType(pa.int64())) | ||
|
|
||
| Unregister the extension type: | ||
|
|
||
| >>> pa.unregister_extension_type("my_package.uuid") | ||
| >>> pa.unregister_extension_type("my_package.rational") | ||
| """ | ||
| cdef: | ||
| c_string c_type_name = tobytes(type_name) | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.