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

Improve the OECD requests #6152

Merged
merged 18 commits into from
Mar 1, 2024
Merged

Improve the OECD requests #6152

merged 18 commits into from
Mar 1, 2024

Conversation

jmaslek
Copy link
Collaborator

@jmaslek jmaslek commented Feb 29, 2024

Pull Request Template for OpenBB Developers

  1. Title:

  2. Why? (1-3 sentences or a bullet point list):

    • When I implemented OECD I was pulling the entire database and caching it. The files are huge so its like a 20-30 second call. This makes the url more granular and implements a different cache idea that makes the key depend on the query params (ignoring dates because they arent jsonable and the filtering is a fast step anyways)
  3. What? (1-3 sentences or a bullet point list):

    • Change the URL to get specific fields instead of all data

    • Change the cache to have a key that depends on the input query params.

  4. Impact (1-2 sentences or a bullet point list):

    • Should not have any impact especially since its not on pro yet.
  5. Testing Done:

    • Trying the endpoint with many different types of

Funcs done:

  • Unemployment
  • LTIR
  • STIR
  • CLI

@jmaslek jmaslek requested a review from deeleeramone February 29, 2024 16:59
@github-actions github-actions bot added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels Feb 29, 2024
Copy link
Contributor

@deeleeramone deeleeramone left a comment

Choose a reason for hiding this comment

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

The start/end date thing needs to be applied to the GDP functions as well. You could also add an "all" to these.

Generally, it's downloading much better now. I made sure to delete all the existing cache.

The test cassettes need to be recaptured and the types in the Fetcher need to be a List[Dict] instead of Dict.

@jmaslek
Copy link
Collaborator Author

jmaslek commented Feb 29, 2024

The start/end date thing needs to be applied to the GDP functions as well. You could also add an "all" to these.

The GDP functions actually need to be updated from the old stats.oecd endpoints to the newer sdmx. That is out of the scope here (those also don't touch cache) -- but is 100% on the roadmap. The start/end are simple enough

@jmaslek jmaslek force-pushed the feature/cleanup-oecd branch from 2039eb9 to 3252bfe Compare February 29, 2024 19:22
]
data_df["date"] = data_df["date"].apply(
lambda x: x.year
) # Validator won't accept datetime.date?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is because the validator is expecting a string representation. Although, because you have already conformed the date field in the extract process, the validator is now redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought that too but it accepts str|date so it was unclear what was actually going wrong

@jmaslek jmaslek added this pull request to the merge queue Mar 1, 2024
Merged via the queue into develop with commit 5f5fad0 Mar 1, 2024
15 checks passed
@the-praxs the-praxs deleted the feature/cleanup-oecd branch March 4, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants