chore: 🔨 outline pytask flow for staging data#152
Closed
martonvago wants to merge 16 commits into
Closed
Conversation
martonvago
commented
Jul 2, 2026
| env_key="REDC_CPH_API_KEY", url="https://redcap.regionh.dk/api/" | ||
| ) | ||
| Odense = APIConfig(env_key="REDC_ODN_API_KEY", url="https://redcap.sdu.dk/api/") | ||
| Test = APIConfig(env_key="TEST_API_KEY", url="https://redcap.au.dk/api/") |
Collaborator
Author
There was a problem hiding this comment.
Can this live here for testing?
martonvago
commented
Jul 2, 2026
Collaborator
Author
There was a problem hiding this comment.
This is all stuff we had before
lwjohnst86
requested changes
Jul 2, 2026
Member
There was a problem hiding this comment.
Hmm, there are too many things going on here in this PR. Can you start very small, with just a task for downloading the dictionary? Then build PRs from there that add one task at a time?
Collaborator
Author
There was a problem hiding this comment.
I was thinking that seeing the whole flow with the function stubs is useful, but if not then sure!
martonvago
commented
Jul 2, 2026
Collaborator
Author
There was a problem hiding this comment.
If we don't want to keep passing the paths around that declare task dependencies, we can move them into a data catalog
martonvago
commented
Jul 2, 2026
Comment on lines
+30
to
+39
| def task_download_data( | ||
| raw_data_dir: Annotated[ | ||
| Path, | ||
| DirectoryNode(root_dir=RAW_REDCAP, pattern="*.csv.gz"), | ||
| Product, | ||
| ], | ||
| ) -> None: | ||
| """Download the latest data from all centers to `RAW_REDCAP/<timestamp>.csv.gz`.""" | ||
| for center in [Center.Copenhagen]: | ||
| download_redcap_data(raw_data_dir, center) |
Collaborator
Author
There was a problem hiding this comment.
Some notes here:
- Dealing with the different centers is a work in progress, but this is a nod in that direction
- pytask doesn't have an "always run this task" option, so data download will only run on
uv run pytaskif theRAW_REDCAPfolder is empty. We can force execution with e.g.
uv run pytask -k download_data --force
uv run pytask
Collaborator
Author
|
Closing in favour of #153 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR outlines how the pytask pipeline could be structured for staging data (see
build.py). I pulled out some common code (dealing with the API, reading/writing JSON) to make the structure clearer.I deliberately removed the implementation of the tasks to focus on where things should be saved and how the tasks should be organised. There is a working draft of the implementation on https://github.com/onlimit-study/feasibility-data/tree/feat/pytask-wip if it's helpful.
Closes #97
Needs a thorough review.
Checklist
just run-all-- well, bits of it