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

add info about update mask to API doc introduction #10572

Merged
merged 2 commits into from
Aug 26, 2020
Merged

add info about update mask to API doc introduction #10572

merged 2 commits into from
Aug 26, 2020

Conversation

ephraimbuddy
Copy link
Contributor

This PR adds information about update_mask to the REST API reference documentation


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Aug 26, 2020
@@ -160,6 +160,14 @@ info:

For details on configuring the authentication, see
[API Authorization](https://airflow.readthedocs.io/en/latest/security/api.html).

# Update Mask
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move it to ### Update section or ## Conventions (first preferred)?

@@ -160,6 +160,14 @@ info:

For details on configuring the authentication, see
[API Authorization](https://airflow.readthedocs.io/en/latest/security/api.html).

# Update Mask
Update mask is available as a parameter in patch endpoints. It is used to notify the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid this has little effect on performance as these are only trivial memory operations.

The main reason for this is that you can get the full object with GET, update the selected fields, then send the full object and only indicate the fields to be updated. In other words, it's necessary to perform a partial update.

resource = request.get('/resource/my-id').json()
resource['my-field'] = 'new-value'
request.patch('/resource/my-id?update-mask=my-field', data=json.dumps(resource)) 

This makes it easier for the client to use the API.

@ephraimbuddy
Copy link
Contributor Author

Ok. I will update it. It was what I read from the link below that formed my explanation. https://developers.google.com/slides/how-tos/field-masks

@mik-laj mik-laj merged commit 276a15a into apache:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants