Skip to content

Commit

Permalink
Merge pull request #174 from bluelabsio/float128_fix
Browse files Browse the repository at this point in the history
Handle exception when machine has no np.float128
  • Loading branch information
ryantimjohn authored Dec 13, 2022
2 parents f2483d2 + c41e09b commit 5c689f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metrics/coverage_high_water_mark
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93.6400
93.6200
7 changes: 6 additions & 1 deletion records_mover/records/schema/field/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def python_type_to_field_type(specific_type: Type[Any]) -> Optional['FieldType']
np.float16: 'decimal',
np.float32: 'decimal',
np.float64: 'decimal',
np.float128: 'decimal',
float: 'decimal',

str: 'string',
Expand All @@ -113,6 +112,12 @@ def python_type_to_field_type(specific_type: Type[Any]) -> Optional['FieldType']

pd.Timestamp: 'datetime',
}
try:
type_mapping[np.float128] = 'decimal'
except AttributeError:
# np.float128 is not available on some machines
pass

if specific_type not in type_mapping:
logger.warning(f"Please teach me how to map {specific_type} into records "
"schema field types")
Expand Down

0 comments on commit 5c689f0

Please sign in to comment.