blackrock / ingen

InGen is a command line tool written on top of pandas and great_expectations to perform small scale data transformations and validations without writing code.
Apache License 2.0
14 stars 5 forks source link

Handle file reading errors in properties.py #6

Closed shpiyu closed 2 months ago

shpiyu commented 1 year ago

Describe the bug InGen reads a property file which contains key value pairs separated by an equal to (=) sign. The class properties.py (ingen/utils/properties.py) is responsible for reading the file from a location which is defined by the OS environment variable config_path. If the file is not present the program exits with a FileNotFoundError. Also close the file after reading it.

To Reproduce Steps to reproduce the behavior:

  1. Set the environment variable config_path
  2. Do not create a config.properties file
  3. Run InGen with any valid yaml file
  4. Program ends with FileNotFoundError

Expected behavior The program should handle this gracefully and throw a helpful error message and how the users can correct it.

Environment

Additional context A feature can be added to allow users to pass the full path of a config file as a command line argument.