GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator

Exception from comparison fields validation with column called dtype.

Open
#1,434 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
524
Forks
171
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Test table, using Oracle as an example but I believe it is applicable to any engine:
```
create table dvt_test.db_str_err (dtype varchar2(10), id varchar2(10));
insert into dvt_test.db_str_err values ('a','b');
commit;
```

Test command:
```
data-validation validate row -sc ora_local -tc ora_local \
-tbls dvt_test.db_str_err -comp-fields="*" --format=csv --filter-status=fail \
--primary-keys=id
...
File "/professional-services-data-validator/.venv/lib/python3.11/site-packages/ibis/backends/base/sql/alchemy/__init__.py", line 157, in fetch_from_cursor
df = pd.DataFrame.from_records(cursor, columns=schema.names, coerce_float=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/professional-services-data-validator/.venv/lib/python3.11/site-packages/pandas/core/frame.py", line 2230, in from_records
if hasattr(first_row, "dtype") and first_row.dtype.names:
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'names'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.