Skip to content

feat!: move publicly exposed constants to a new public constants file#2636

Open
MortGron wants to merge 2 commits into
masterfrom
expose-pulic-constants
Open

feat!: move publicly exposed constants to a new public constants file#2636
MortGron wants to merge 2 commits into
masterfrom
expose-pulic-constants

Conversation

@MortGron

@MortGron MortGron commented May 22, 2026

Copy link
Copy Markdown
Contributor

Description

Some constants that were part of the public interface were included in a private constatns file. These constants have been move to a new public constatns file.

Alternatively, all constants could be moved to this new file, and private constants can have a leading underscore, or what is public can be set with _all_.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • The PR title follows the Conventional Commit spec.

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.46154% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.07%. Comparing base (8a8a106) to head (880001f).

Files with missing lines Patch % Lines
cognite/client/constants.py 90.90% 1 Missing ⚠️
...a_classes/data_modeling/extractor_extensions/v1.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2636      +/-   ##
==========================================
- Coverage   93.08%   93.07%   -0.01%     
==========================================
  Files         486      487       +1     
  Lines       49671    49674       +3     
==========================================
+ Hits        46235    46236       +1     
- Misses       3436     3438       +2     
Files with missing lines Coverage Δ
cognite/client/_api/annotations.py 95.65% <100.00%> (ø)
cognite/client/_api/assets.py 97.35% <100.00%> (ø)
cognite/client/_api/data_modeling/containers.py 98.14% <100.00%> (ø)
cognite/client/_api/data_modeling/data_models.py 100.00% <100.00%> (ø)
cognite/client/_api/data_modeling/instances.py 90.30% <100.00%> (ø)
cognite/client/_api/data_modeling/spaces.py 100.00% <100.00%> (ø)
cognite/client/_api/data_modeling/views.py 98.03% <100.00%> (ø)
cognite/client/_api/data_sets.py 100.00% <100.00%> (ø)
cognite/client/_api/datapoints.py 98.50% <100.00%> (ø)
cognite/client/_api/datapoints_subscriptions.py 96.15% <100.00%> (ø)
... and 108 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MortGron MortGron marked this pull request as ready for review May 22, 2026 09:02
@MortGron MortGron requested review from a team as code owners May 22, 2026 09:02

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request migrates several constants and the Omitted sentinel from the internal _constants.py module to a new public constants.py module, updating imports across the SDK and its auto-generated sync layers. The review feedback identifies an oversight where some constants in files.py were still being imported from the private module and suggests clarifying the visibility of _RUNNING_IN_BROWSER to ensure its naming aligns with its intended public or private use.

Comment thread cognite/client/_api/files.py
Comment thread cognite/client/constants.py Outdated
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.

1 participant