-
Notifications
You must be signed in to change notification settings - Fork 6
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
As a User, I can launch a request knowing that all readers follow a common behavior on date parameters #67
Comments
Hello ! So I've been working a bit on this issue. I have taken a look at all the readers in order to understand how they work and how they manage the date range option. First, here is a basic overview : - Adobe Reader:
- Adobe Reader v2:
- DBM Reader :
- DCM Reader :
- Facebook Reader :
- Ga Reader :
- Googleads reader :
- radarly_reader :
- SA360reader, SearchConsoleReader, ttd_reader, twitter_ready :
- yandex_statistics_reader :
So here's a proposition to manage date ranges in a uniform way for all readers :
Should we create unique functions in the helpers module and make all readers import it ? Is it feasible and practical ? |
Hello @ali-artefact, Thank you for this overview of date management in NCK and your suggestions. I agree with your first point. First, it is ok to duplicate code but it will be one of the points to be tackled in the incoming refactoring. Regarding your second and third points, one thing you pointed out in your overview is how a couple of readers use default values (especially the DBM reader). My take is that default values should not exist at all. We want the user to explicitly define the period of time of the API request. So I suggest to remove all default values (set as a parameter of click options or directly in the code) and then make a custom validation function that follows the requirements you proposed. Finally, to be sure I've understood correctly your proposal, do you want to raise an exception if the case Given an end_date and a generic date_range parameter often called day_range in the function happens? |
Thank you for your prompt answer @benoitgoujon, I agree with you, as discussed, all implicit behaviours should be deleted. Regarding your last concern, I reckon I should have explicitly given the sentence I was referring to. Anyways, you got it right. Although theoretically this could be a solution, I assume the less possibilities are given to the user, the better it is. |
Yes absolutely! So to summarize, here are our technical specs (correct me if I'm wrong): The user can define the date range in 2 ways:
One way does not override the other. If there is a conflict, we throw an exception. All other cases that do not match the two conditions previously defined will result in an exception being thrown. Does that sound good to you? |
@ali-artefact thank you very much for your detailed overview of the current behavior of the different readers. I am aligned with the specs you just defined together, and the fact of removing default behaviors regarding dates, which can be confusing. Good job guys! 👍 |
Then we're all set 👍 |
@ali-artefact @gabrielleberanger @benoitgoujon Therefore, what do you think about adding a new layer allowing the use of day ranges for api which normally don't allow day ranges as parameters ? One idea could be to add a function which will set start date and end date based on the current date and the range specified by the user. I guess this kind of solution also has drawbacks so let me know if it would make sense to you in this case. |
Hi @tom-grivaud, To me, this is fine and that could bring value to the user indeed. I think, this is especially relevant in the case you do not generate the commands dynamically and you don't have an orchestrator to populate the date parameters at runtime. So, I would vote in favour of this new feature and I can develop it if you want. |
Alright, what do you guys think @gabrielleberanger @ali-artefact ? |
@tom-grivaud as I told you earlier, I think it's a great idea too ! I am creating a dedicated issue for it. Thank you @benoitgoujon for taking it 👌 |
@ali-artefact one note before you jump into the code, the behaviour of the Adobe v2 reader has slightly evolved after @tom-grivaud's suggestion. So, what you described is no longer up to date. There is the possibility to add a date range now. The rest is still valid 🙂 |
Duly noted ! No problem. |
WHY
Today, the behavior of readers expecting date parameters (
start_date
,end_date
,date_range
, etc.) is not harmonized.In particular, readers usually do not know how to prioritize the date parameters given as inputs. For instance: the Google Ads reader crashes if you try to make a request including the
start_date
andend_date
parameters + adate_range
parameter.HOW
Define a convention for all readers, and implement it.
The text was updated successfully, but these errors were encountered: