-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
feat(reports): adding flag for removing the index on the report CSV #29335
base: master
Are you sure you want to change the base?
feat(reports): adding flag for removing the index on the report CSV #29335
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #29335 +/- ##
===========================================
+ Coverage 60.48% 83.75% +23.26%
===========================================
Files 1931 519 -1412
Lines 76236 37637 -38599
Branches 8568 0 -8568
===========================================
- Hits 46114 31524 -14590
+ Misses 28017 6113 -21904
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I did wonder about making the def mutate_api_call(url: str, parameter: str) -> str:
Args:
url (str): The url to process.
parameter (str): The parameter to remove
Returns:
str: The url with the parameter removed."""
if "?" not in url:
return url
base_url, query_string = url.split("?", 1)
params = query_string.split("&")
filtered_params = [param for param in params if param != parameter]
filtered_query_string = "&".join(filtered_params)
filtered_url = f"{base_url}?{filtered_query_string}"
return filtered_url I would then move it into a more general if not current_app.config["CSV_INDEX"]:
url = mutate_api_call(url, "type=post_processed") |
@SkinnyPigeon do you think this would be better handled at the report level as opposed from a system wide configuration? |
Yes, you're probably correct 😄. I doubt I would have the capacity to do the changes across both the frontend and backend to achieve that. What are the recommendations for getting a piece of work like that done on this repo? |
@SkinnyPigeon this looks more like a configuration of your report than a global setting. We should include an option here. @eschutho |
Thanks all. I will try to give it a look but if there's anyone you know in the community that's more familiar with working with the modals in the frontend, feel free to pass their names on and I am more than happy to reach out to them and see if we can work together to get this done |
SUMMARY
Some of our account managers send their reports in CSV format. Currently, the index is shown in the CSV due to the
POST_PROCESSED
value being set in the call to the API. This is causing a few complaints from our clients due to the need for them to remove the column when working with the report data.There is a current PR that has been ongoing for over a year and appears to have stalled. I have linked this below. Since this is unlikely to be completed, I am opening this in the hopes that we can resolve it sooner. As opposed to their approach, I reformat the
url
used to call the API based on theCSV_INDEX
, leaving it as-is for its default behaviour.Issue #22981
Current PR
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION