Skip to content

Tags: lucyking140/api-python

Tags

v2.1.2

Toggle v2.1.2's commit message
Bump version to {version}

v2.1.2rc1

Toggle v2.1.2rc1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Pass a header into calls to mixer for usage logs (datacommonsorg#276)

- Adds a `clientlib-python` header to the newer `datacommons_client`
client library
- This does not include the older `datacommons` client because it makes
calls to the V1 API, which will be deprecated soon.
- These are used in Mixer's usage logs
- The header accepts an optional `surface_header_value` tag in the
observation endpoints so that other DC surfaces that make calls to the
client library (MCP server, DataGemma, etc.) can be tracked.
- Theoretically, others could also pass in other values for this tag if
they make calls directly to the python client library. Like with custom
DCs, I plan to accept that this might happen in rare cases because these
usage logs will be aggregated over many queries.

Tests:
- Checked with local mixer that the metadata is correctly updated in the
`clientlib-python` case and when we pass in `metadata_source`
- Modified current test suite to include this header in the expected
response.