fixing check factor schema errors
This commit is contained in:
@@ -1648,10 +1648,14 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
|||||||
datadf = pl.concat(data)
|
datadf = pl.concat(data)
|
||||||
existing_columns = [col for col in columns if col in datadf.columns]
|
existing_columns = [col for col in columns if col in datadf.columns]
|
||||||
datadf = datadf.select(existing_columns)
|
datadf = datadf.select(existing_columns)
|
||||||
except (ShapeError, SchemaError, ColumnNotFoundError):
|
except (ShapeError, SchemaError):
|
||||||
data = [
|
try:
|
||||||
df.select(columns)
|
data = [
|
||||||
for df in data]
|
df.select(columns)
|
||||||
|
for df in data]
|
||||||
|
except ColumnNotFoundError:
|
||||||
|
existing_columns = [col for col in columns if col in df.columns]
|
||||||
|
df = df.select(existing_columns)
|
||||||
|
|
||||||
# float columns
|
# float columns
|
||||||
floatcolumns = []
|
floatcolumns = []
|
||||||
@@ -1686,14 +1690,19 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
|||||||
]
|
]
|
||||||
except ComputeError:
|
except ComputeError:
|
||||||
pass
|
pass
|
||||||
|
except ColumnNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
datadf = pl.concat(data)
|
datadf = pl.concat(data)
|
||||||
except SchemaError:
|
except SchemaError:
|
||||||
data = [
|
try:
|
||||||
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
data = [
|
||||||
]
|
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
||||||
datadf = pl.concat(data)
|
]
|
||||||
|
datadf = pl.concat(data)
|
||||||
|
except ShapeError:
|
||||||
|
return pl.DataFrame()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user