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)
|
||||
existing_columns = [col for col in columns if col in datadf.columns]
|
||||
datadf = datadf.select(existing_columns)
|
||||
except (ShapeError, SchemaError, ColumnNotFoundError):
|
||||
data = [
|
||||
df.select(columns)
|
||||
for df in data]
|
||||
except (ShapeError, SchemaError):
|
||||
try:
|
||||
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
|
||||
floatcolumns = []
|
||||
@@ -1686,14 +1690,19 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
||||
]
|
||||
except ComputeError:
|
||||
pass
|
||||
except ColumnNotFoundError:
|
||||
pass
|
||||
|
||||
try:
|
||||
datadf = pl.concat(data)
|
||||
except SchemaError:
|
||||
data = [
|
||||
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
||||
]
|
||||
datadf = pl.concat(data)
|
||||
try:
|
||||
data = [
|
||||
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
||||
]
|
||||
datadf = pl.concat(data)
|
||||
except ShapeError:
|
||||
return pl.DataFrame()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user