-
Notifications
You must be signed in to change notification settings - Fork 35
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
IndexError list index out of range exception when creating StringSubstitutionFilter #104
Comments
More info: the replaced tildes already occur in the options_dict and args_dict which are passed to the ETL constructor. They're coming from the parse_args function in stetl.main. I suspect this piece of code is responsible for this error:
Note that in the For now, I'll use another character as a workaround in my StringSubstitutionFilter, since it is not really a problem in my case. |
At least the tilde and separator are assigned/used as defaults in Convert a string to a dict
Think this was introduced in one of the first versions to support long strings for In hinsight the For now: maybe there is a way to change the defaults |
This also happens when trying to import bagv2:
|
I'm getting an IndexError: list index out of range exception when creating a StringSubstitutionFilter. Stack trace:
This happens when the config file contains placeholders which are passed through the command line and when the value contains spaces which are represented with tildes. Example:
stetl -c blah.cfg -a myvalue=contains~space
Previously, as a workaround, I passed those values as environment variables, like
export STETL_myvalue=contains~space
. Then this error doesn't occur.As you can see, this occurs in Stetl version 2.1-dev, but this also happened before the 2.0 versions.
During debugging, I found out that after I create the ETL object (
etl = ETL(vars(args_parsed), args_parsed.config_args)
) and show the config_dict, the relevant section is shown like this:It is clear that the tilde is replaced by a space earlier in the process, at the creation of the ETL object.
So, when this is passed to string_to_dict, the dict_arr will look like this:
[['myvalue','contains'],['space']]
, which obviously causes the IndexError, since the second array only contains one element.I haven't looked yet where this error exactly occurs. This must happen after extra arguments are passed through -a, but not when arguments are passed as environment variables with the 'STETL_'-prefix.
The text was updated successfully, but these errors were encountered: