fix(ingest): tweak mongodb schema inference to fix test (#5744)

This commit is contained in:
Harshal Sheth 2022-08-26 11:15:16 -07:00 committed by GitHub
parent e448bb8832
commit fa0fd7b830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1419 deletions

View File

@ -155,6 +155,9 @@ def construct_schema(
# if single type detected, mark that as the type to go with
if len(field_types.keys()) == 1:
field_type = next(iter(field_types))
elif set(field_types.keys()) == {int, float}:
# If there's only floats and ints, it's not really a mixed type.
field_type = float
field_extended: SchemaDescription = {
"types": schema[field_path]["types"],
"count": schema[field_path]["count"],