Skip to main content

Convert Pyarrow schema to Unity Catalog schema

Project description

Github Actions Status

pyarrow-unity

This library provides functions to convert Pyarrow schema to Unity Catalog schema.

Installation

pip install pyarrow-unity

Functions

model_unity_schema(schema) Converts a Pyarrow schema to a list of Unity Catalog columns.

Parameters:

  • schema: The Pyarrow schema to convert.

Returns: A list of Column objects representing the Unity Catalog schema.

Example:

import pyarrow as pa
from pyarrow_unity.model import model_unity_schema

schema = pa.schema([
    pa.field('col1', pa.int32(), nullable=True),
    pa.field('col2', pa.string(), nullable=False),
    pa.field('col3', pa.decimal128(10, 2), nullable=True)
])

columns = model_unity_schema(schema)
for column in columns:
    print(f"Name: {column.name}, Type: {column.type_name}, Nullable: {column.nullable}")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyarrow_unity-0.1.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

pyarrow_unity-0.1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page