Skip to content

feat(gooddata-sdk): [AUTO] add x_gdc_correlation parameter to get_label_elements()#1453

Closed
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P038-enriched-label-elements
Closed

feat(gooddata-sdk): [AUTO] add x_gdc_correlation parameter to get_label_elements()#1453
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P038-enriched-label-elements

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Add optional x_gdc_correlation parameter to CatalogWorkspaceContentService.get_label_elements() to forward the x-gdc-correlation HTTP header to the label elements API endpoint.

P038 | Workflow: https://github.com/gooddata/gdc-nas/actions/runs/23194184862

What changed in gdc-nas

Commit dc0729ffeat: enrich label elements with query tags

  • ElementsController.kt: Added @RequestHeader x-gdc-correlation parameter (CorrelationHeader?) and passes it to ElementsProcessor.process()
  • CorrelationHeader.kt: Added toExecutionInitiator() method converting header fields to ExecutionInitiatorDisplay
  • ElementsPreprocessingContext.kt: Added enableQueryTags: Boolean field
  • CalciqueClient.kt: labelElementsInfo() now accepts optional executionInitiator parameter
  • CalciqueGrpcService.kt: Builds query tags from executionInitiator when present and sets them as a query comment
  • elements-request.proto: Added ExecutionInitiator executionInitiator = 5 field to ElementsRequest message

The backend now accepts x-gdc-correlation header on POST /api/v1/actions/workspaces/{workspaceId}/execution/collect/label/elements and uses it to embed query tags in SQL for debugging.

What was implemented in SDK

  • Added x_gdc_correlation: str | None = None keyword parameter to get_label_elements() for backward compatibility
  • Conditionally forwards x_gdc_correlation to compute_label_elements_post() via paging_params dict when the regenerated gooddata-api-client exposes the header parameter
  • Added mock-based unit test test_get_label_elements_forwards_x_gdc_correlation verifying the parameter is forwarded correctly

Files modified

  • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/content_service.py
  • packages/gooddata-sdk/tests/catalog/test_catalog_workspace_content.py

JIRA: PENDING (Jira ticket will be created after review)
Risk: Low

…el_elements()

Adds optional x_gdc_correlation: str | None = None keyword argument to
CatalogWorkspaceContentService.get_label_elements() and forwards it to
compute_label_elements_post() as a header kwarg for query tagging support
(once the API client is regenerated with x-gdc-correlation header support).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.25%. Comparing base (4dc3f87) to head (0549cd2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1453   +/-   ##
=======================================
  Coverage   77.24%   77.25%           
=======================================
  Files         227      227           
  Lines       14672    14674    +2     
=======================================
+ Hits        11334    11336    +2     
  Misses       3338     3338           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hkad98 hkad98 closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants