Skip to content

TypeError: read_json() got an unexpected keyword argument 'header' #189

@nasxisbest

Description

@nasxisbest
ModelError: Received server error (500) from primary with message "read_json() got an unexpected keyword argument 'header'
          Traceback (most recent call last):
            File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 150, in transform
              result = self._run_handler_function(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 280, in _run_handler_function
              result = func(*argv)
                       ^^^^^^^^^^^
            File "/opt/ml/model/code/tabular_serve.py", line 55, in transform_fn
              data = _read_with_fallback(pd.read_json, buf, column_names)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/opt/ml/model/code/tabular_serve.py", line 141, in _read_with_fallback
              data = read_func(buf, header=None)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
          TypeError: read_json() got an unexpected keyword argument 'header'

Exact place where issue occurs:

Afaik, header argument is only available in read_csv. Will try to fix this if this will become a blocker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions