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

Reverse fromDay and fromTable call order in CurrencyAverageRatesService #7

Open
maciej-sz opened this issue May 5, 2023 · 2 comments
Labels

Comments

@maciej-sz
Copy link
Owner

Currently the api requires to first call fromDay and then fromTable:

$averageRatesService->fromDay('2023-01-01')->fromTable('A');

This causes the need to iterate month tables on the spot. All tables must be iterated in order to build the TablesDictionary. This diminishes all advantages of using generator, because even if no data is actually used from those tables the full iteration of those tables takes place.

Switching the api to first call fromTable would allow to produce generators which will be called only on actual usage. Also it would not cause triggering the generator of other tables if only one table is picked.

@maciej-sz maciej-sz added the bug label May 5, 2023
@mkarolczyk
Copy link

Hey, are you going to solve this problem in the near future? I am only using table A, but in the last 2 months I have a constant problem because table B has "no data" at the beginning of the month. Even though I am not using table B, I am not able to retrieve the data itself from table A.

@maciej-sz
Copy link
Owner Author

Hey @mkarolczyk I will look into it but resolving it in a way proposed in the above description of this issue would be a huge BC break and will probably be introduced only in the next major version. There should probably be a separate fix for the situation you described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants