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

RequestFilter Enums don't map to values accepted by the API. #3

Open
willtech3 opened this issue Mar 2, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working fix in v1 This will be fixed in v1 of the Python SDK.

Comments

@willtech3
Copy link

willtech3 commented Mar 2, 2021

RequestFilter.FORECASTS.HR produces the value '#hr' which is the name of a filter but not an accepted value.

For example if I create a request using the Python SDK.

forecast_list = aeris.forecasts(
  location=loc,
  filter_=[RequestFilter.FORECASTS.HR],
  params={
    ParameterType.FORECASTS.FIELDS: "periods.avgTempF,periods.validTime,periods.precipIN",
  })

The url produced by the SDK is.
https://api.aerisapi.com/forecasts/55455?client_id=<client_id>&client_secret=<client_secret>&fields=periods.avgTempF,periods.validTime,periods.precipIN&filter=#hr,

It's easy enough for SDK consumers to write our own Enums to pass to the filter_ parameter however the trailing , still causes the filter value to be invalid.

The trailing comma issue is shown in this pull-request by bkurtz

@jkoelndorfer jkoelndorfer self-assigned this Mar 2, 2021
@jkoelndorfer
Copy link
Contributor

Hi @willtech3,

Thanks for the bug report. Pull request #2 has been merged. As I mentioned in a comment there, it is my intent to revamp the Python SDK at some point in the future. I am aware that there are a few bits of the current Python SDK that aren't working quite right, and it could do with some cleanup in general.

I will leave this open as a reminder that this specific bug should be reviewed when the Python SDK is improved.

@jkoelndorfer jkoelndorfer added fix in v1 This will be fixed in v1 of the Python SDK. bug Something isn't working labels Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix in v1 This will be fixed in v1 of the Python SDK.
Projects
None yet
Development

No branches or pull requests

2 participants