Skip to content
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

AttributeError for np.float128 on M1 machines #175

Closed
austinweisgrau opened this issue Nov 15, 2022 · 0 comments · Fixed by #174
Closed

AttributeError for np.float128 on M1 machines #175

austinweisgrau opened this issue Nov 15, 2022 · 0 comments · Fixed by #174
Assignees

Comments

@austinweisgrau
Copy link
Contributor

Numpy does not have a float128 type available on certain machines, including the M1.

Records mover imports this type whether or not it is used, and throws an exception if the attribute is not available.

16:05:29 - Using session_type=lpass from config file
16:05:29 - Starting...
16:05:31 - Mover: copying from DataUrlRecordsSource(None) to TableRecordsTarget(redshift) by first writing DataUrlRecordsSource(None) to DelimitedRecordsFormat(csv - {'dateformat': 'YYYY-MM-DD', 'datetimeformat': 'YYYY-MM-DD HH:MI:SS', 'datetimeformattz': 'YYYY-MM-DD HH:MI:SSOF'}) records format (if easy to rewrite)...
16:05:31 - Determining records format with initial_hints={'compression': None}
16:05:31 - Inferred record terminator as '\n'
16:05:31 - Python csv.Dialect sniffed: {'doublequote': False, 'field-delimiter': ',', 'header-row': True, 'quotechar': '"'}
16:05:33 - Attempting to parse with quoting: minimal
16:05:33 - Inferred hints from combined sources: {'compression': None, 'quoting': 'minimal', 'doublequote': False, 'field-delimiter': ',', 'header-row': True, 'quotechar': '"', 'encoding': 'UTF8', 'record-terminator': '\n'}
16:05:33 - 
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/job/mover.py", line 37, in run_records_mover_job
    return records.move(source, target, processing_instructions)
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/mover.py", line 122, in move
    with records_source.\
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/sources/data_url.py", line 46, in to_fileobjs_source
    with FileobjsSource.\
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/sources/fileobjs.py", line 74, in infer_if_needed
    RecordsSchema.from_fileobjs(list(target_names_to_input_fileobjs.values()),
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/schema/__init__.py", line 163, in from_fileobjs
    schema = RecordsSchema.from_dataframe(df, processing_instructions,
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/schema/__init__.py", line 241, in from_dataframe
    return schema_from_dataframe(df=df,
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/schema/pandas.py", line 27, in schema_from_dataframe
    fields.append(RecordsSchemaField.
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/field/__init__.py", line 132, in from_series
return field_from_series(series=series,
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/field/pandas.py", line 83, in field_from_series
    field_type, constraints = details_from_numpy_dtype(series.dtype, unique=False)
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/field/numpy.py", line 27, in details_from_numpy_dtype
    field_type = RecordsSchemaField.python_type_to_field_type(dtype.type)
  File "/opt/homebrew/lib/python3.10/site-packages/records_mover/records/schema/field/__init__.py", line 98, in python_type_to_field_type
    np.float128: 'decimal',
  File "/opt/homebrew/lib/python3.10/site-packages/numpy/__init__.py", line 315, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float128'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant