Comments (4)
For sure! <assignment_id>
is a child of <project_id>
in a one-to-many relationship -- each project has many assignments, but each assignment belongs to only one project.
Edit: If it helps, the assignment
endpoint relies on project_id
as well, it's just the first part of the subtask
endpoint -- /api/v1/projects/<project_id>/assignments
from verified-sources.
I'll add another vote to this enhancement! Currently working with an API that wants two different IDs in the endpoint to return subtask
data:
/api/v1/projects/<project_id>/assignments/<assignment_id>/subtasks
from verified-sources.
Hey @jecolvin thanks for the input. Could you please share how <project_id>
and <assignment_id>
are related? dlt needs to figure out how to iterate over both <project_id>
and <assignment_id>
.
from verified-sources.
@burnash Followup on my work and a proposal for a v1 of this feature:
I discovered I could get the project_id
form the assignment
endpoint, it was just named differently than I expected (assignable_id
). So I could populate both params using a single resource. Relevant code:
@dlt.transformer(data_from=assignments, write_disposition="replace")
def subtasks(assignments):
@dlt.defer
def _get_subtasks(_assignment):
project_id = _assignment["assignable_id"]
assignment_id = _assignment["id"]
for page in client.paginate(
path=f"projects/{project_id}/assignments/{assignment_id}/subtasks",
params={"per_page": 250},
):
yield page
for _assignment in assignments:
yield _get_subtasks(_assignment)
That might be a good v1 for multiple resolve params: You can declare multiple resolve params as long as they all come from the same resource. That way it should still be a single, straightforward transformer.
from verified-sources.
Related Issues (20)
- rest_api: Extend `response_actions` to accept hook functions
- rest_api: Allow to specify a conversion function for the cursor field in incremental load configuration HOT 1
- webhook verified source HOT 4
- import_schema_path yaml.constructor.ConstructorError HOT 1
- rest_api: rename `json_response` paginator to `json_link`
- rest_api: pluggable paginators HOT 1
- rest_api: Clarify how we specify incremental loading HOT 6
- rest_api: Request param incremental configuration should not accept keys that it ignores
- add filter to mongodb source HOT 2
- rest_api: Pluggable Custom Authentication/Authorization HOT 1
- Add column selection and filtering to sql_database source HOT 6
- rest_api: params in resource_defaults do not get merged with resource params
- `sql_database` source with `pyarrow` backend does not support `json` typed columns from MySQL HOT 1
- rest_api: incremental config: rename `transform` to `convert`
- Extend dlt_init to test if a verified source is installable
- Google Sheet: Unformatted date column not loaded correctly, if the the first row contains no value for that column HOT 2
- Replace full_refresh to dev_mode in all examples HOT 1
- rest_api: Add `OAuth2ClientCredentials` to the list of built-in auth methods
- pg_replication init fails with error HOT 2
- Extend generic API source to allow for incremental path parameters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from verified-sources.