Skip to content

Added Accessor #55

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

Merged
merged 8 commits into from
Feb 3, 2025
Merged

Added Accessor #55

merged 8 commits into from
Feb 3, 2025

Conversation

mrm9084
Copy link
Contributor

@mrm9084 mrm9084 commented Jan 30, 2025

Description

Adds option of adding a callback that sets the targeting context.

Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Pull request includes test coverage for the included changes.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR.

@mrm9084 mrm9084 requested review from rossgrambo and Copilot January 30, 2025 22:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

featuremanagement/_featuremanagerbase.py:243

  • The error message could be more informative. Suggestion: logging.warning("targeting_context_accessor did not return a TargetingContext. Received type: {}".format(type(targeting_context)))
logging.warning("targeting_context_accessor did not return a TargetingContext")

featuremanagement/_featuremanagerbase.py:240

  • Ensure that the new behavior introduced by the targeting_context_accessor is covered by tests, including cases where it returns a valid TargetingContext and where it does not.
targeting_context = self._targeting_context_accessor()

@mrm9084 mrm9084 marked this pull request as ready for review February 3, 2025 19:28
@mrm9084 mrm9084 requested a review from Copilot February 3, 2025 19:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • samples/formatted_feature_flags.json: Language not supported
  • featuremanagement/_featuremanager.py: Evaluated as low risk
Comments suppressed due to low confidence (2)

featuremanagement/_featuremanagerbase.py:243

  • Returning None instead of an empty TargetingContext could lead to NoneType errors. Ensure the calling code handles None properly.
return None

featuremanagement/_featuremanagerbase.py:282

  • Inconsistent use of logging. Should use logger.warning instead of logging.warning.
logging.warning("Feature flag %s not found", feature_flag_id)

@mrm9084 mrm9084 merged commit 4a7a64b into feature/exp-telemetry Feb 3, 2025
4 checks passed
@mrm9084 mrm9084 deleted the Accessor branch February 3, 2025 22:28
mrm9084 added a commit that referenced this pull request Apr 24, 2025
* Added Accessor (#55)

* Added Accessor with comments

* comment and format change

* fixing log

* fixing log length

* async version with tests

* fix test and pylint issue

* Update featuremanagement/aio/_featuremanager.py

Co-authored-by: Ross Grambo <[email protected]>

* Update _featuremanager.py

---------

Co-authored-by: Ross Grambo <[email protected]>

* New OTel Integration (#54)

* New OTel Integration

* fixing issues

* pylint fixes

* fixing mypy issues

* Update _send_telemetry.py

* Update _send_telemetry.py

* Update dev_requirements.txt

* fixing checks

* Update _send_telemetry.py

* Update _send_telemetry.py

* trying mypy fix

* Update _send_telemetry.py

* Update to use accessor

* remove attach_targeting_info

* added tests

* Adding Quart sample

* Added otel to quart sample

* Update requirements.txt

* Updating Version/Status

* review comments

* Update _version.py

---------

Co-authored-by: Ross Grambo <[email protected]>
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