Skip to content

Confusing results when different field values are used for Integer columns #787

Answered by fnikitathom
fnikitathom asked this question in Q&A
Discussion options

You must be logged in to vote

Well after almost 2 days of going nuts I've figured out what the problem was, my inability to think outside the box, until I looked at the traceback again:

  File "/usr/local/lib/python3.8/site-packages/pandera/checks.py", line 961, in _str_length
    return series.str.len() <= max_value

Which prompted my changing the code to:

    k = {}
    df = pd.read_sql(
    f"SELECT NameStrNotQuoted, FieldTypeName, SizeStr, Precision, Scale FROM dbo.vw_cx_meta WHERE [Table] = '{table_name}' and Organization='{org}' AND ETL_Active = 1",
    engine,
    )
    for row in df.itertuples(index=False):
        if row.FieldTypeName == "int":
            if row.NameStrNotQuoted in ['CreatedBy','UpdatedBy']:…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@fnikitathom
Comment options

@fnikitathom
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by fnikitathom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants