Problem description:
If I run detect on a Redshift database with a new catalog db specified for the run, it returns this:
piicatcher --catalog-host localhost --catalog-port 5432 --catalog-user piicatcher --catalog-password --catalog-database piicatcher_1 detect --source-name --scan-type metadata --include-schema
Traceback (most recent call last):
File "/home/ec2-user/.env/bin/piicatcher", line 8, in
sys.exit(app())
File "/home/ec2-user/.env/lib64/python3.7/site-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ec2-user/.env/lib64/python3.7/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/home/ec2-user/.env/lib64/python3.7/site-packages/piicatcher/command_line.py", line 196, in detect
source = catalog.get_source(source_name)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/dbcat/catalog/catalog.py", line 191, in get_source
.filter(CatSource.name == source_name)
File "/home/ec2-user/.env/lib64/python3.7/site-packages/sqlalchemy/orm/query.py", line 3500, in one
raise orm_exc.NoResultFound("No row was found for one()")
sqlalchemy.orm.exc.NoResultFound: No row was found for one()
Expected Result;
A new db with all the required metadata tables gets created for the scan to happen (if the table does not exist already)
Can you run add_redshift command?
https://tokern.io/docs/piicatcher/#command-line-usage
I'll keep this issue open to improve the error message
Also it is better to specify the catalog information in a config file.
https://tokern.io/docs/catalog/configuration#config-file
@yourssvk - Still facing the issue? Can you please try and let me know if issue still persist!
Meanwhile improved error message.
@yjagdale not in a position to test this at this point. Please feel free to close
Thanks for the issue @yourssvk. Tested at my end and working as expected. Also improved error message for the same.