Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow passing parameters intoto_pandas call #578

Open
Assignees
madhav-db
@j-bennet

Description

@j-bennet

When creating aConnection, currently it's possible to configure some aspects of pandas / arrow, such as_use_arrow_native_complex_types and_use_arrow_native_timestamps, but_convert_arrow_table uses a hardcoded type mapper that's impossible to change:

dtype_mapping= {
pyarrow.int8():pandas.Int8Dtype(),
pyarrow.int16():pandas.Int16Dtype(),
pyarrow.int32():pandas.Int32Dtype(),
pyarrow.int64():pandas.Int64Dtype(),
pyarrow.uint8():pandas.UInt8Dtype(),
pyarrow.uint16():pandas.UInt16Dtype(),
pyarrow.uint32():pandas.UInt32Dtype(),
pyarrow.uint64():pandas.UInt64Dtype(),
pyarrow.bool_():pandas.BooleanDtype(),
pyarrow.float32():pandas.Float32Dtype(),
pyarrow.float64():pandas.Float64Dtype(),
pyarrow.string():pandas.StringDtype(),
}

Similarly, there's no way to pass other parameters to theto_pandas call here:

df=table_renamed.to_pandas(
types_mapper=dtype_mapping.get,
date_as_object=True,
timestamp_as_object=True,
)

Please consider extending the connection parameters to add more flexibility.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp