https://dagster.io/ logo
Title
i

iskander

10/30/2022, 8:33 PM
Hi! I'm on dagster 14.14. I have a question regarding dagster_pandas. I have a column such as
PandasColumn.integer_column("col_name", _non_nullable_=False, _is_required_=True),
I'm querying MySQL 5.7 data and get the following error:
Description: Violated "ColumnDTypeFnConstraint" for column "col_name" - Dtype must satisfy "is_integer_dtype", but was "object"
DESCRIBE TABLE xxxx; -> Field: col_name, Type: int(20), Null: YES Could someone give a hint on what might be the problem?
:dagster-bot-responded-by-community: 1
:dagster-bot-resolve: 1
g

GTC

10/31/2022, 12:18 AM
The message is saying that the data type of the column is not as expected. Perhaps you need
DataFrame.astype(dtype)
for converting the data type of
col_name
from
object
to
int
.
s

sean

10/31/2022, 5:58 PM
Hi iskander, your issue is likely somewhere outside of
dagster-pandas
and instead at the level where data is loaded into Python from your database. As GTC points out, the column you are passing to
dagster-pandas
is for whatever reason not being loaded as a
pandas
integer series but instead
object
. All that said, you should be aware that we recommend
dagster-pandera
over
dagster-pandas
, which is only lightly maintained.
❤️ 1