Fix: sort dataset keys in error message when importing non-existing dataset #2497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes: It's hard to hunt down the dataset you're looking for if the list is not sorted.
For example, when trying to load the
solar_dataset
with underscore instead of hyphen, you get (using single backticks to get the output wrapped over multiple lines)AssertionError: solar_energy is not present, please choose one from dict_keys(['constant', 'exchange_rate', 'solar-energy', 'electricity', 'traffic', 'exchange_rate_nips', 'electricity_nips', 'traffic_nips', 'solar_nips', 'wiki-rolling_nips', 'taxi_30min', 'kaggle_web_traffic_with_missing', 'kaggle_web_traffic_without_missing', 'kaggle_web_traffic_weekly', 'm1_yearly', 'm1_quarterly', 'm1_monthly', 'nn5_daily_with_missing', 'nn5_daily_without_missing', 'nn5_weekly', 'tourism_monthly', 'tourism_quarterly', 'tourism_yearly', 'cif_2016', 'london_smart_meters_without_missing', 'wind_farms_without_missing', 'car_parts_without_missing', 'dominick', 'fred_md', 'pedestrian_counts', 'hospital', 'covid_deaths', 'kdd_cup_2018_without_missing', 'weather', 'm3_monthly', 'm3_quarterly', 'm3_yearly', 'm3_other', 'm4_hourly', 'm4_daily', 'm4_weekly', 'm4_monthly', 'm4_quarterly', 'm4_yearly', 'm5', 'uber_tlc_daily', 'uber_tlc_hourly', 'airpassengers']).
while with this fix you get
AssertionError: solar_energy is not present, please choose one from ['airpassengers', 'car_parts_without_missing', 'cif_2016', 'constant', 'covid_deaths', 'dominick', 'electricity', 'electricity_nips', 'exchange_rate', 'exchange_rate_nips', 'fred_md', 'hospital', 'kaggle_web_traffic_weekly', 'kaggle_web_traffic_with_missing', 'kaggle_web_traffic_without_missing', 'kdd_cup_2018_without_missing', 'london_smart_meters_without_missing', 'm1_monthly', 'm1_quarterly', 'm1_yearly', 'm3_monthly', 'm3_other', 'm3_quarterly', 'm3_yearly', 'm4_daily', 'm4_hourly', 'm4_monthly', 'm4_quarterly', 'm4_weekly', 'm4_yearly', 'm5', 'nn5_daily_with_missing', 'nn5_daily_without_missing', 'nn5_weekly', 'pedestrian_counts', 'solar-energy', 'solar_nips', 'taxi_30min', 'tourism_monthly', 'tourism_quarterly', 'tourism_yearly', 'traffic', 'traffic_nips', 'uber_tlc_daily', 'uber_tlc_hourly', 'weather', 'wiki-rolling_nips', 'wind_farms_without_missing'].
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup