Skip to content

AttributeError: 'pyarrow.lib.DataType' object has no attribute 'tz' #303

@zzl221000

Description

@zzl221000
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/deadpool.py", line 871, in raw_runner2
    results = fn(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^
  File "/app/src/xx_data_tool/pipeline/base.py", line 191, in start_from_toml
    pipeline.run()
  File "/app/src/xx_data_tool/pipeline/base.py", line 146, in run
    self.sink.write(processed)
  File "/app/src/xx_data_tool/pipeline/connects/odps_connect.py", line 48, in write
    self.write(item)
  File "/app/src/xx_data_tool/pipeline/connects/odps_connect.py", line 45, in write
    writer.write(pa.Table.from_batches([batch]).to_pandas())
  File "/app/.venv/lib/python3.12/site-packages/odps/models/tableio.py", line 546, in write
    self._write_contents(writer, *args)
  File "/app/.venv/lib/python3.12/site-packages/odps/models/tableio.py", line 683, in _write_contents
    writer.write(arg)
  File "/app/.venv/lib/python3.12/site-packages/odps/tunnel/io/writer.py", line 1066, in write
    super(BufferedArrowWriter, self).write(data)
  File "/app/.venv/lib/python3.12/site-packages/odps/tunnel/io/writer.py", line 893, in write
    col = self._localize_timezone(column_dict[lower_name])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/odps/tunnel/io/writer.py", line 753, in _localize_timezone
    if col.type.tz is not None:
       ^^^^^^^^^^^
AttributeError: 'pyarrow.lib.DataType' object has no attribute 'tz'

Metadata

Metadata

Assignees

No one assigned

    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