Skip to content

refactor(gooddata-sdk): migrate @attr.s to @define#1380

Merged
hkad98 merged 1 commit intogooddata:masterfrom
hkad98:jkd/attrs
Mar 2, 2026
Merged

refactor(gooddata-sdk): migrate @attr.s to @define#1380
hkad98 merged 1 commit intogooddata:masterfrom
hkad98:jkd/attrs

Conversation

@hkad98
Copy link
Contributor

@hkad98 hkad98 commented Mar 2, 2026

Summary

  • Unify all attrs usage in gooddata-sdk to the modern @define API, eliminating three co-existing styles (@attr.s, @attrs.define, @define with redundant auto_attribs)
  • Migrate 175 classes across 82 files to use bare from attrs import define, field, ... with @define
  • Drop all redundant auto_attribs=True parameters and normalize attr.field/Factory/asdict to bare imports

… models

Unify attrs usage to the modern `@define` API (recommended since attrs 20.1.0).
This eliminates three co-existing styles (@attr.s, @attrs.define, @define with
redundant auto_attribs) in favor of a single consistent pattern: bare `@define`
with `from attrs import define, field, ...`.

Key changes across 82 files:
- @attr.s / @attr.s(auto_attribs=True) → @define
- @attr.s(auto_attribs=True, kw_only=True) → @define(kw_only=True)
- @attrs.define(...) → @define(...)
- Dropped redundant auto_attribs=True from existing @define calls
- attr.field/Factory/asdict/Attribute → field/Factory/asdict/Attribute
- import attr / import attrs → from attrs import define, ...
- from attr.setters → from attrs.setters

Enables slots=True by default (@define's default), which is safe here:
no dynamic attribute assignment, max 2-level inheritance, cattrs-compatible.

JIRA: trivial
risk: low
@hkad98 hkad98 requested review from jaceksan, lupko and pcerny as code owners March 2, 2026 12:46
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 99.87421% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.55%. Comparing base (c00ca3b) to head (5fd3de0).
⚠️ Report is 31 commits behind head on master.

Files with missing lines Patch % Lines
packages/gooddata-sdk/src/gooddata_sdk/config.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1380       +/-   ##
===========================================
+ Coverage    0.00%   77.55%   +77.55%     
===========================================
  Files         158      224       +66     
  Lines       11048    14432     +3384     
===========================================
+ Hits            0    11193    +11193     
+ Misses      11048     3239     -7809     

☔ 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 merged commit a19bac3 into gooddata:master Mar 2, 2026
14 of 20 checks passed
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