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

Trailing new lines in config.properties file crashes the application #7

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 contains a new line the code crashes with following error:

  File ".../interface-generator/ingen/utils/properties.py", line 35, in initialize_properties
    self.property_map[list_property[0]] = list_property[1]
IndexError: list index out of range

To Reproduce Steps to reproduce the behavior:

  1. Set environment variable config_path to any location
  2. Create a config.properties file in that location
  3. Add an empty line at the end or anywhere in the file
  4. An IndexError is thrown because the code is trying to parse an empty line

Expected behavior Any empty lines should be ignored.

Environment (please complete the following information):

Additional context related issue #6