Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema validation error with Postgres #410

Closed
FX-HAO opened this issue Mar 30, 2022 · 0 comments
Closed

Schema validation error with Postgres #410

FX-HAO opened this issue Mar 30, 2022 · 0 comments

Comments

@FX-HAO
Copy link
Contributor

FX-HAO commented Mar 30, 2022

I'm running schema validation with the following command:

data-validation validate schema --source-conn source --target-conn target -tbls public.users

but got the error

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 493, in <module>
    main()
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 483, in main
    validate(args)
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 461, in validate
    run(args)
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 421, in run
    run_validations(args, config_managers)
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 400, in run_validations
    run_validation(config_manager, verbose=args.verbose)
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/__main__.py", line 389, in run_validation
    validator.execute()
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/data_validation.py", line 94, in execute
    result_df = self.schema_validator.execute()
  File "/Users/fuxin.haocrypto.com/github/professional-services-data-validator/data_validation/schema_validation.py", line 36, in execute
    ibis_source_schema = self.config_manager.source_client.get_schema(
AttributeError: 'PostgreSQLClient' object has no attribute 'get_schema' 

Seems we need to have a custom class extending PostgreSQLClient and implementing get_schema just like MSSQLClient or other third-party clients.
Or we can have a method just like get_ibis_table to wrap the source_client.get_schema() function and handle the difference.

I'd like to make a PR to fix this :)

FX-HAO added a commit to FX-HAO/professional-services-data-validator that referenced this issue Mar 30, 2022
FX-HAO added a commit to FX-HAO/professional-services-data-validator that referenced this issue Mar 31, 2022
FX-HAO added a commit to FX-HAO/professional-services-data-validator that referenced this issue Mar 31, 2022
FX-HAO added a commit to FX-HAO/professional-services-data-validator that referenced this issue Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants