diff --git a/flagsmith/mappers.py b/flagsmith/mappers.py index 8d8179a..7564a89 100644 --- a/flagsmith/mappers.py +++ b/flagsmith/mappers.py @@ -93,7 +93,6 @@ def map_context_and_identity_data_to_context( **context, "identity": { "identifier": identifier, - "key": f"{context['environment']['key']}_{identifier}", "traits": { trait_key: ( trait_value_or_config["value"] @@ -200,7 +199,6 @@ def _map_identity_overrides_to_segments( overrides=[ { "key": "", # Identity overrides never carry multivariate options - "feature_key": str(flagsmith_id), "name": feature_name, "enabled": feature_enabled, "value": feature_value, @@ -245,7 +243,6 @@ def _map_environment_document_feature_states_to_feature_contexts( key=str( feature_state.get("django_id") or feature_state["featurestate_uuid"] ), - feature_key=str(feature_state["feature"]["id"]), name=feature_state["feature"]["name"], enabled=feature_state["enabled"], value=feature_state["feature_state_value"], diff --git a/poetry.lock b/poetry.lock index 7b7aedf..4d9f539 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.2.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "certifi" @@ -259,14 +259,14 @@ files = [ [[package]] name = "flagsmith-flag-engine" -version = "9.1.0" +version = "10.0.0" description = "Flag engine for the Flagsmith API." optional = false python-versions = "*" groups = ["main"] files = [ - {file = "flagsmith_flag_engine-9.1.0-py3-none-any.whl", hash = "sha256:1afe9aa37469ce4208f5e62c2a90669e2fdada401d4b795b339ea9bf019da733"}, - {file = "flagsmith_flag_engine-9.1.0.tar.gz", hash = "sha256:d18f8daef0684f1b0224a9f98c279c966cafd29d52444682705c474247d3b4ce"}, + {file = "flagsmith_flag_engine-10.0.0-py3-none-any.whl", hash = "sha256:da9dec37556416a6bec2004ec6dbe7e2581dfdd24167fe224a2280db7f01c011"}, + {file = "flagsmith_flag_engine-10.0.0.tar.gz", hash = "sha256:c3318504d904532cb4673df849cfc222ccbd92915d1697d34c9e9e55f3f5eb53"}, ] [package.dependencies] @@ -947,4 +947,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.1" python-versions = ">=3.9,<4" -content-hash = "7feced3e0ab64b956db1c6eaf112aa2553494bf4a27127a5afd0a8062d952917" +content-hash = "cfe10e9fdb3ea780c9d8fae0f9cf8b92b3a37356be13633f655d910f71e0035e" diff --git a/pyproject.toml b/pyproject.toml index c1df2ec..858d6b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ documentation = "https://docs.flagsmith.com" packages = [{ include = "flagsmith" }] [tool.poetry.dependencies] -flagsmith-flag-engine = "^9.1.0" +flagsmith-flag-engine = "^10.0.0" python = ">=3.9,<4" requests = "^2.32.3" requests-futures = "^1.0.1" diff --git a/tests/test_flagsmith.py b/tests/test_flagsmith.py index 6d5258c..ce9219b 100644 --- a/tests/test_flagsmith.py +++ b/tests/test_flagsmith.py @@ -165,7 +165,6 @@ def test_get_identity_flags_uses_local_environment_when_available( "name": "some_feature", "enabled": True, "value": "some-feature-state-value", - "feature_key": "1", "metadata": {"flagsmith_id": 1}, } }, diff --git a/tests/test_models.py b/tests/test_models.py index 35d960d..7cc8283 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -10,7 +10,6 @@ def test_flag_from_evaluation_result() -> None: # Given flag_result: SDKFlagResult = { "enabled": True, - "feature_key": "123", "name": "test_feature", "reason": "DEFAULT", "value": "test-value", @@ -36,7 +35,6 @@ def test_flag_from_evaluation_result() -> None: { "feature1": { "enabled": True, - "feature_key": "1", "name": "feature1", "reason": "DEFAULT", "value": "value1", @@ -49,7 +47,6 @@ def test_flag_from_evaluation_result() -> None: { "feature1": { "enabled": True, - "feature_key": "1", "name": "feature1", "reason": "DEFAULT", "value": "value1", @@ -62,7 +59,6 @@ def test_flag_from_evaluation_result() -> None: { "feature1": { "enabled": True, - "feature_key": "1", "name": "feature1", "reason": "DEFAULT", "value": "value1", @@ -70,7 +66,6 @@ def test_flag_from_evaluation_result() -> None: }, "feature2": { "enabled": True, - "feature_key": "2", "name": "feature2", "reason": "DEFAULT", "value": "value2", @@ -78,7 +73,6 @@ def test_flag_from_evaluation_result() -> None: }, "feature3": { "enabled": True, - "feature_key": "3", "name": "feature3", "reason": "DEFAULT", "value": 42, @@ -130,7 +124,6 @@ def test_flag_from_evaluation_result_value_types( # Given flag_result: SDKFlagResult = { "enabled": True, - "feature_key": "123", "name": "test_feature", "reason": "DEFAULT", "value": value, @@ -148,7 +141,6 @@ def test_flag_from_evaluation_result_missing_metadata__raises_expected() -> None # Given flag_result: SDKFlagResult = { "enabled": True, - "feature_key": "123", "name": "test_feature", "reason": "DEFAULT", "value": "test-value",