Skip to content
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

extend exception for invalid offset_name #3115

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

Borda
Copy link
Contributor

@Borda Borda commented Jan 31, 2024

Issue #, if available: it is quite hard to understand why the exception was raised when you do not see the values

Description of changes: extend the exception, which will help a user understand what went wrong...

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

cc: @jaheba, @lostella, @kashif, @rshyamsundar

@kashif
Copy link
Contributor

kashif commented Jan 31, 2024

lets fix the issue, which is i believe that pandas has deprecated some of the freq strings.
Screenshot 2024-01-29 at 11 44 14
Screenshot 2024-01-29 at 11 46 01

@Borda
Copy link
Contributor Author

Borda commented Feb 1, 2024

lets fix the issue, which is i believe that pandas has deprecated some of the freq strings.

That is a good point; if you do not mind, I will split it into two PRs as these springs are used in multiple places, and this PR keeps focused on the exception enrichment... So, I would take the conversion of the string just after :)

@Borda
Copy link
Contributor Author

Borda commented Feb 1, 2024

@kashif, based on your reaction, if you are fine with keeping this PR simple, would you mind approving Ci and reviewing it? :)

@kashif
Copy link
Contributor

kashif commented Feb 1, 2024

I am not a maintainer so have no such power... but I believe they will review it

@@ -146,7 +146,7 @@ def _make_lags_for_month(multiple, num_cycles=3):
+ _make_lags_for_hour(offset.n / (60 * 60))
)
else:
raise Exception("invalid frequency")
raise ValueError(f"invalid frequency | `freq_str={freq_str}` -> `offset_name={offset_name}`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise ValueError(f"invalid frequency | `freq_str={freq_str}` -> `offset_name={offset_name}`")
raise ValueError(f"invalid frequency: {freq_str=}, {offset_name=}")

@lostella
Copy link
Contributor

lostella commented Feb 1, 2024

@Borda thanks for this! Just left a comment on improving the message, let me know what you think.

There’s a lot of red in the workflows, I’ll take a look and try to unblock PRs

@lostella lostella merged commit e7f9d50 into awslabs:dev Feb 1, 2024
13 of 19 checks passed
@lostella lostella added the pending v0.14.x backport This contains a fix to be backported to the v0.14.x branch label Feb 1, 2024
@Borda Borda deleted the ex/freq_str branch February 1, 2024 21:21
@Borda
Copy link
Contributor Author

Borda commented Feb 1, 2024

thanks for this! Just left a comment on improving the message, let me know what you think.

yes, that looks better, but seems you merged it before I could update it

There’s a lot of red in the workflows, I’ll take a look and try to unblock PRs

lostella pushed a commit to lostella/gluonts that referenced this pull request Feb 2, 2024
@lostella lostella mentioned this pull request Feb 2, 2024
lostella added a commit that referenced this pull request Feb 2, 2024
*Description of changes:* backporting fixes
- #3094 
- #3115 

Additionally: cap pandas version to <2.2


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

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
@lostella lostella removed the pending v0.14.x backport This contains a fix to be backported to the v0.14.x branch label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants