posthog 8.2.7__tar.gz → 8.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. {posthog-8.2.7/posthog.egg-info → posthog-8.2.8}/PKG-INFO +1 -1
  2. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_async_datasets.py +1 -1
  3. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_client.py +7 -7
  4. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_datasets.py +1 -1
  5. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_scorers.py +1 -1
  6. {posthog-8.2.7 → posthog-8.2.8}/posthog/client.py +2 -2
  7. {posthog-8.2.7 → posthog-8.2.8}/posthog/feature_flags.py +22 -1
  8. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_transport.py +36 -4
  9. posthog-8.2.8/posthog/test/test_feature_flags_person_metadata.py +511 -0
  10. {posthog-8.2.7 → posthog-8.2.8}/posthog/types.py +3 -3
  11. posthog-8.2.8/posthog/version.py +1 -0
  12. {posthog-8.2.7 → posthog-8.2.8/posthog.egg-info}/PKG-INFO +1 -1
  13. {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/SOURCES.txt +1 -0
  14. {posthog-8.2.7 → posthog-8.2.8}/pyproject.toml +1 -1
  15. posthog-8.2.7/posthog/version.py +0 -1
  16. {posthog-8.2.7 → posthog-8.2.8}/LICENSE +0 -0
  17. {posthog-8.2.7 → posthog-8.2.8}/MANIFEST.in +0 -0
  18. {posthog-8.2.7 → posthog-8.2.8}/README.md +0 -0
  19. {posthog-8.2.7 → posthog-8.2.8}/posthog/__init__.py +0 -0
  20. {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_consumer.py +0 -0
  21. {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_request.py +0 -0
  22. {posthog-8.2.7 → posthog-8.2.8}/posthog/_async_utils.py +0 -0
  23. {posthog-8.2.7 → posthog-8.2.8}/posthog/_disabled_lane_queue.py +0 -0
  24. {posthog-8.2.7 → posthog-8.2.8}/posthog/_logging.py +0 -0
  25. {posthog-8.2.7 → posthog-8.2.8}/posthog/_metrics_autocapture.py +0 -0
  26. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/__init__.py +0 -0
  27. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/__init__.py +0 -0
  28. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/_anthropic_stream.py +0 -0
  29. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic.py +0 -0
  30. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_async.py +0 -0
  31. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_converter.py +0 -0
  32. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/anthropic/anthropic_providers.py +0 -0
  33. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/__init__.py +0 -0
  34. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/client.py +0 -0
  35. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/formatting.py +0 -0
  36. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/claude_agent_sdk/processor.py +0 -0
  37. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/__init__.py +0 -0
  38. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_dataset_serialization.py +0 -0
  39. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_dataset_types.py +0 -0
  40. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_errors.py +0 -0
  41. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_mutations.py +0 -0
  42. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_scorer_types.py +0 -0
  43. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_serialization.py +0 -0
  44. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_tags.py +0 -0
  45. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_transport.py +0 -0
  46. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/evaluations/_types.py +0 -0
  47. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gateway.py +0 -0
  48. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/__init__.py +0 -0
  49. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/_shared.py +0 -0
  50. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini.py +0 -0
  51. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini_async.py +0 -0
  52. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/gemini/gemini_converter.py +0 -0
  53. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/__init__.py +0 -0
  54. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/callbacks.py +0 -0
  55. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/langchain/middleware.py +0 -0
  56. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/media.py +0 -0
  57. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/__init__.py +0 -0
  58. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/_embeddings.py +0 -0
  59. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/_streaming.py +0 -0
  60. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai.py +0 -0
  61. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_async.py +0 -0
  62. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_converter.py +0 -0
  63. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/openai_providers.py +0 -0
  64. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai/wrapper_utils.py +0 -0
  65. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai_agents/__init__.py +0 -0
  66. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/openai_agents/processor.py +0 -0
  67. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/__init__.py +0 -0
  68. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/_privacy.py +0 -0
  69. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/_request_context.py +0 -0
  70. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/exporter.py +0 -0
  71. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/processor.py +0 -0
  72. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/otel/spans.py +0 -0
  73. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/prompts.py +0 -0
  74. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/sanitization.py +0 -0
  75. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/stream.py +0 -0
  76. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/types.py +0 -0
  77. {posthog-8.2.7 → posthog-8.2.8}/posthog/ai/utils.py +0 -0
  78. {posthog-8.2.7 → posthog-8.2.8}/posthog/args.py +0 -0
  79. {posthog-8.2.7 → posthog-8.2.8}/posthog/async_client.py +0 -0
  80. {posthog-8.2.7 → posthog-8.2.8}/posthog/bucketed_rate_limiter.py +0 -0
  81. {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_compression.py +0 -0
  82. {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_event.py +0 -0
  83. {posthog-8.2.7 → posthog-8.2.8}/posthog/capture_send.py +0 -0
  84. {posthog-8.2.7 → posthog-8.2.8}/posthog/consumer.py +0 -0
  85. {posthog-8.2.7 → posthog-8.2.8}/posthog/contexts.py +0 -0
  86. {posthog-8.2.7 → posthog-8.2.8}/posthog/emails.py +0 -0
  87. {posthog-8.2.7 → posthog-8.2.8}/posthog/exception_capture.py +0 -0
  88. {posthog-8.2.7 → posthog-8.2.8}/posthog/exception_utils.py +0 -0
  89. {posthog-8.2.7 → posthog-8.2.8}/posthog/feature_flag_evaluations.py +0 -0
  90. {posthog-8.2.7 → posthog-8.2.8}/posthog/flag_definition_cache.py +0 -0
  91. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/__init__.py +0 -0
  92. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/_tracing_headers.py +0 -0
  93. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/asgi.py +0 -0
  94. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/celery.py +0 -0
  95. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/django.py +0 -0
  96. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/drf.py +0 -0
  97. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/flask.py +0 -0
  98. {posthog-8.2.7 → posthog-8.2.8}/posthog/integrations/otel.py +0 -0
  99. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/__init__.py +0 -0
  100. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_argument_ownership.py +0 -0
  101. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_capture.py +0 -0
  102. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_compatibility.py +0 -0
  103. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_context_parameters.py +0 -0
  104. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_conversation_id.py +0 -0
  105. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_event_types.py +0 -0
  106. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_exceptions.py +0 -0
  107. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_ids.py +0 -0
  108. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_fastmcp.py +0 -0
  109. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_lowlevel.py +0 -0
  110. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrument_v2.py +0 -0
  111. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_instrumentation.py +0 -0
  112. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_intent.py +0 -0
  113. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_internal.py +0 -0
  114. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_model_parameters.py +0 -0
  115. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_output_instructions.py +0 -0
  116. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_posthog_events.py +0 -0
  117. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_raised_tool_error.py +0 -0
  118. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_sanitization.py +0 -0
  119. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_server_build.py +0 -0
  120. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_sink.py +0 -0
  121. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_tool_input.py +0 -0
  122. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_transport_identity.py +0 -0
  123. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/_truncation.py +0 -0
  124. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/asgi.py +0 -0
  125. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/constants.py +0 -0
  126. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/feedback.py +0 -0
  127. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/logger.py +0 -0
  128. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/posthog_mcp.py +0 -0
  129. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/request_headers.py +0 -0
  130. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/session.py +0 -0
  131. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/session_token.py +0 -0
  132. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/tools.py +0 -0
  133. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/types.py +0 -0
  134. {posthog-8.2.7 → posthog-8.2.8}/posthog/mcp/version.py +0 -0
  135. {posthog-8.2.7 → posthog-8.2.8}/posthog/metrics_capture.py +0 -0
  136. {posthog-8.2.7 → posthog-8.2.8}/posthog/poller.py +0 -0
  137. {posthog-8.2.7 → posthog-8.2.8}/posthog/py.typed +0 -0
  138. {posthog-8.2.7 → posthog-8.2.8}/posthog/release_id.py +0 -0
  139. {posthog-8.2.7 → posthog-8.2.8}/posthog/request.py +0 -0
  140. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/__init__.py +0 -0
  141. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/__init__.py +0 -0
  142. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/__init__.py +0 -0
  143. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_client.py +0 -0
  144. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_processor.py +0 -0
  145. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/claude_agent_sdk/test_processor_content.py +0 -0
  146. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/openai_agents/__init__.py +0 -0
  147. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/openai_agents/test_processor.py +0 -0
  148. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/__init__.py +0 -0
  149. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/conftest.py +0 -0
  150. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_exporter.py +0 -0
  151. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_processor.py +0 -0
  152. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/otel/test_spans.py +0 -0
  153. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_async_cancellation.py +0 -0
  154. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_async_stream_wrapper.py +0 -0
  155. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_capture_contract.py +0 -0
  156. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_capture_pipeline.py +0 -0
  157. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations.py +0 -0
  158. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_datasets.py +0 -0
  159. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_mutations.py +0 -0
  160. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_evaluations_scorers.py +0 -0
  161. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_gateway.py +0 -0
  162. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_http_status.py +0 -0
  163. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_media.py +0 -0
  164. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_privacy_mode.py +0 -0
  165. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_prompts.py +0 -0
  166. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_sanitization.py +0 -0
  167. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_stream_midstream_error.py +0 -0
  168. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_system_prompts.py +0 -0
  169. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_token_reporting.py +0 -0
  170. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_tokens_source.py +0 -0
  171. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/test_utils.py +0 -0
  172. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/ai/utils.py +0 -0
  173. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/capture_helpers.py +0 -0
  174. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/conftest.py +0 -0
  175. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/logging_helpers.py +0 -0
  176. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/__init__.py +0 -0
  177. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers.py +0 -0
  178. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers_lowlevel.py +0 -0
  179. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/_helpers_v2.py +0 -0
  180. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/conftest.py +0 -0
  181. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_asgi.py +0 -0
  182. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_capture.py +0 -0
  183. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_conversation_session.py +0 -0
  184. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_defaults.py +0 -0
  185. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_error_properties.py +0 -0
  186. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_error_status.py +0 -0
  187. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp.py +0 -0
  188. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_tool_errors.py +0 -0
  189. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_v2.py +0 -0
  190. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_fastmcp_v4.py +0 -0
  191. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_features_m4.py +0 -0
  192. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_feedback.py +0 -0
  193. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_initialize_handshake.py +0 -0
  194. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrument_lowlevel_ownership.py +0 -0
  195. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrument_v2.py +0 -0
  196. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_instrumentation_fork.py +0 -0
  197. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_lib_label.py +0 -0
  198. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_lowlevel.py +0 -0
  199. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_model_parameters.py +0 -0
  200. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_no_crash.py +0 -0
  201. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_output_instructions.py +0 -0
  202. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_pending_tasks.py +0 -0
  203. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_pipeline.py +0 -0
  204. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_posthog_mcp.py +0 -0
  205. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_request_headers.py +0 -0
  206. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_resources.py +0 -0
  207. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_review_fixes.py +0 -0
  208. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_send_tools_list_event.py +0 -0
  209. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_session_token.py +0 -0
  210. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_tool_input.py +0 -0
  211. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_transport_identity.py +0 -0
  212. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_truncation.py +0 -0
  213. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_types.py +0 -0
  214. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_units.py +0 -0
  215. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_unknown_tool.py +0 -0
  216. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_lowlevel.py +0 -0
  217. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_mcpserver.py +0 -0
  218. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_v2_wire_dual_era.py +0 -0
  219. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/mcp/test_virtual_tools.py +0 -0
  220. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/released_flags_scenarios.py +0 -0
  221. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_ai_capture_lane.py +0 -0
  222. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_client.py +0 -0
  223. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_consumer.py +0 -0
  224. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_feature_flags.py +0 -0
  225. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_request.py +0 -0
  226. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_async_utils.py +0 -0
  227. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_before_send.py +0 -0
  228. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_bucketed_rate_limiter.py +0 -0
  229. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_compression.py +0 -0
  230. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_event.py +0 -0
  231. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_invariants.py +0 -0
  232. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_capture_send.py +0 -0
  233. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client.py +0 -0
  234. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client_crap_flags.py +0 -0
  235. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_client_fork.py +0 -0
  236. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_code_variables.py +0 -0
  237. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_consumer.py +0 -0
  238. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_contexts.py +0 -0
  239. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_emails.py +0 -0
  240. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_evaluate_flags.py +0 -0
  241. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_event_options.py +0 -0
  242. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_exception_capture.py +0 -0
  243. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_exception_utils.py +0 -0
  244. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_experiment_exposure.py +0 -0
  245. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_failed_flag_records.py +0 -0
  246. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag.py +0 -0
  247. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_called_minimization.py +0 -0
  248. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_has_experiment.py +0 -0
  249. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flag_result.py +0 -0
  250. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flags.py +0 -0
  251. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_feature_flags_regex.py +0 -0
  252. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_cache_eviction_reads.py +0 -0
  253. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_cache_publication.py +0 -0
  254. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_definition_cache.py +0 -0
  255. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flag_payload_parsing.py +0 -0
  256. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flags_released_behaviour.py +0 -0
  257. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_flags_v4_response.py +0 -0
  258. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_gevent_compat.py +0 -0
  259. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_metrics.py +0 -0
  260. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_metrics_autocapture.py +0 -0
  261. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_module.py +0 -0
  262. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_posthog_upgrade_workflow.py +0 -0
  263. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_property_matching_version.py +0 -0
  264. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_redis_flag_cache_snapshot.py +0 -0
  265. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_reference_markdown.py +0 -0
  266. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_release_id.py +0 -0
  267. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_request.py +0 -0
  268. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_server_payload_snapshots.py +0 -0
  269. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_size_limited_dict.py +0 -0
  270. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_types.py +0 -0
  271. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_utils.py +0 -0
  272. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/test_utils_acceptance.py +0 -0
  273. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/__init__.py +0 -0
  274. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/conftest.py +0 -0
  275. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/helpers.py +0 -0
  276. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_client_traces.py +0 -0
  277. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_config.py +0 -0
  278. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_export.py +0 -0
  279. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_ids.py +0 -0
  280. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_limits.py +0 -0
  281. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_otlp.py +0 -0
  282. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_pipeline.py +0 -0
  283. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_sanitize.py +0 -0
  284. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_span.py +0 -0
  285. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_traceparent.py +0 -0
  286. {posthog-8.2.7 → posthog-8.2.8}/posthog/test/tracing/test_transport.py +0 -0
  287. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/__init__.py +0 -0
  288. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_before_span_send.py +0 -0
  289. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_config.py +0 -0
  290. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_context.py +0 -0
  291. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_drops.py +0 -0
  292. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_export.py +0 -0
  293. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_ids.py +0 -0
  294. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_limits.py +0 -0
  295. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_otlp.py +0 -0
  296. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_pipeline.py +0 -0
  297. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_sanitize.py +0 -0
  298. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_span.py +0 -0
  299. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_traceparent.py +0 -0
  300. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/_transport.py +0 -0
  301. {posthog-8.2.7 → posthog-8.2.8}/posthog/tracing/span.py +0 -0
  302. {posthog-8.2.7 → posthog-8.2.8}/posthog/utils.py +0 -0
  303. {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/dependency_links.txt +0 -0
  304. {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/requires.txt +0 -0
  305. {posthog-8.2.7 → posthog-8.2.8}/posthog.egg-info/top_level.txt +0 -0
  306. {posthog-8.2.7 → posthog-8.2.8}/setup.cfg +0 -0
  307. {posthog-8.2.7 → posthog-8.2.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: posthog
3
- Version: 8.2.7
3
+ Version: 8.2.8
4
4
  Summary: Integrate PostHog into any python application.
5
5
  Home-page: https://github.com/posthog/posthog-python
6
6
  Author: Posthog
@@ -40,7 +40,7 @@ from ._transport import AsyncTransport
40
40
  class AsyncDatasets:
41
41
  """Manage datasets through ``AsyncOfflineEvaluations.datasets``.
42
42
 
43
- Requires a personal key with ``dataset:read`` or ``dataset:write`` and the
43
+ Requires a key with ``dataset:read`` or ``dataset:write`` and the
44
44
  datasets feature enabled. Mutations return after acknowledgment; only item
45
45
  creates with a caller-supplied ``client_item_id`` are automatically retried.
46
46
  Other lost write responses require inspecting state before retrying.
@@ -277,7 +277,7 @@ class Experiment:
277
277
  return None if self._submission is None else json.loads(self._submission)
278
278
 
279
279
  def get_tags(self) -> tuple[str, ...]:
280
- """Fetch current tags using a personal key with ``evaluation:read``."""
280
+ """Fetch current tags using a key with ``evaluation:read``."""
281
281
  with self._lock:
282
282
  data = self._transport.request("GET", self._path)
283
283
  return _experiment_tags(data, self.id)
@@ -285,7 +285,7 @@ class Experiment:
285
285
  def set_tags(self, tags: Sequence[str]) -> tuple[str, ...]:
286
286
  """Replace tags and return the server's normalized names; [] clears them.
287
287
 
288
- Requires a personal key with ``evaluation:write``. Tags can change after
288
+ Requires a key with ``evaluation:write``. Tags can change after
289
289
  completion and are separate from the immutable creation ``submission``.
290
290
  Updates are not retried automatically: inspect tags after a lost response.
291
291
  """
@@ -645,11 +645,11 @@ class AsyncExperiment:
645
645
  class OfflineEvaluations:
646
646
  """Upload offline evaluations and manage scorers and datasets in one project.
647
647
 
648
- ``secret_key`` accepts personal or project secret keys with
649
- offline_evaluation_ingestion:write. Scorer reads/writes require a personal
650
- key with llm_analytics:read/write; datasets require dataset:read/write.
651
- Editing accepted data requires an evaluation editor's personal key with
652
- evaluation:write. Result operations and item deletion also need scorer access.
648
+ Pass a personal API key or a project secret API key for this project.
649
+ Uploads require offline_evaluation_ingestion:write. Scorers use
650
+ llm_analytics:read/write and datasets use dataset:read/write. Corrections
651
+ require evaluation:write. Result edits and item deletion also require
652
+ llm_analytics:read. Personal keys need the user's resource permissions.
653
653
  Each operation requires its corresponding product feature to be enabled.
654
654
  ``host`` defaults to the US app API; known ingestion hosts are mapped to
655
655
  their app hosts. Custom hosts are preserved. Requests use a 15 second
@@ -40,7 +40,7 @@ from ._transport import SyncTransport
40
40
  class Datasets:
41
41
  """Manage datasets through ``OfflineEvaluations.datasets``.
42
42
 
43
- Requires a personal key with ``dataset:read`` or ``dataset:write`` and the
43
+ Requires a key with ``dataset:read`` or ``dataset:write`` and the
44
44
  datasets feature enabled. Mutations return after acknowledgment; only item
45
45
  creates with a caller-supplied ``client_item_id`` are automatically retried.
46
46
  Other lost write responses require inspecting state before retrying.
@@ -379,7 +379,7 @@ def _version_params(limit: int, cursor: str | None) -> dict[str, str | int]:
379
379
 
380
380
 
381
381
  class Scorers:
382
- """Manage scorers using a personal key with ``llm_analytics`` scopes.
382
+ """Manage scorers using a key with ``llm_analytics`` scopes.
383
383
 
384
384
  Access through ``OfflineEvaluations.scorers``. Creating a scorer or version
385
385
  is not idempotent: mutations are never retried automatically. If a response
@@ -4279,8 +4279,8 @@ class Client(object):
4279
4279
  self.log.warning(
4280
4280
  f"[FEATURE FLAGS] {len(unsupported_definition_keys)} flag(s) use "
4281
4281
  "something local evaluation doesn't support, such as a static "
4282
- "cohort, an unknown operator, a malformed value, or a missing or "
4283
- "circular flag dependency "
4282
+ "cohort, an unknown operator or filter type, a malformed value, or a "
4283
+ "missing or circular flag dependency "
4284
4284
  f"(reason: {UnresolvedFlagReason.UNSUPPORTED_DEFINITION.value}): "
4285
4285
  f"{', '.join(unsupported_definition_keys)}. Evaluating them makes a "
4286
4286
  "remote request when evaluation reaches that part, or leaves them "
@@ -629,6 +629,7 @@ def _match_flag_conditions(
629
629
  cohort_properties,
630
630
  group_type_mapping,
631
631
  )
632
+ e.reason = _pick_unresolved_reason(inconclusive_reason, e.reason)
632
633
  raise
633
634
  except InconclusiveMatchError as e:
634
635
  # Evaluation error (bad regex, invalid date, missing property, etc.)
@@ -795,6 +796,22 @@ def _match_feature_enrollment(flag, flag_filters, properties) -> bool:
795
796
  return enrollment is True or enrollment == "true"
796
797
 
797
798
 
799
+ # Filter types matched against the person or group properties the caller passes. Cohort
800
+ # and flag filters have their own matching. Any other type, such as "person_metadata"
801
+ # (a value /flags reads from the persons table, not from person properties), can't be
802
+ # evaluated locally: matching it against a caller property with the same key could
803
+ # disagree with /flags. A missing, null, or empty type is a person filter.
804
+ _PROPERTY_FILTER_TYPES = (None, "", "person", "group")
805
+
806
+
807
+ def _assert_property_filter_type_supported(prop) -> None:
808
+ if prop.get("type") not in _PROPERTY_FILTER_TYPES:
809
+ raise InconclusiveMatchError(
810
+ f"Can't evaluate a '{prop['type']}' filter on '{prop.get('key')}' locally",
811
+ reason=UnresolvedFlagReason.UNSUPPORTED_DEFINITION,
812
+ )
813
+
814
+
798
815
  def _match_condition_filter(
799
816
  prop,
800
817
  properties,
@@ -829,6 +846,7 @@ def _match_condition_filter(
829
846
  device_id=device_id,
830
847
  property_matching_version=property_matching_version,
831
848
  )
849
+ _assert_property_filter_type_supported(prop)
832
850
  return match_property(prop, properties, property_matching_version)
833
851
 
834
852
 
@@ -930,6 +948,7 @@ def _raise_condition_errors(feature_flag, server_evaluation_error, inconclusive_
930
948
  # Re-raise the original error type: match_feature_flag_properties stops at it
931
949
  # and falls back to the server instead of trying later conditions.
932
950
  if server_evaluation_error is not None:
951
+ server_evaluation_error.reason = inconclusive_reason
933
952
  raise server_evaluation_error
934
953
  if inconclusive_reason is not None:
935
954
  raise InconclusiveMatchError(
@@ -1730,9 +1749,10 @@ def match_property_group(
1730
1749
  )
1731
1750
  if effective_match != is_and:
1732
1751
  decisive_result = effective_match
1733
- except RequiresServerEvaluation:
1752
+ except RequiresServerEvaluation as e:
1734
1753
  # Static/missing cohorts and malformed definitions always require server evaluation,
1735
1754
  # even when another branch would otherwise resolve the group locally.
1755
+ e.reason = _pick_unresolved_reason(inconclusive_reason, e.reason)
1736
1756
  raise
1737
1757
  except InconclusiveMatchError as e:
1738
1758
  log.debug(f"Failed to compute property {prop} locally: {e}")
@@ -1841,6 +1861,7 @@ def _is_unsupported_property(
1841
1861
  return _is_unsupported_dependency(prop, flags_by_key)
1842
1862
  if property_type != "cohort":
1843
1863
  try:
1864
+ _assert_property_filter_type_supported(prop)
1844
1865
  _assert_filter_supported(prop)
1845
1866
  except InconclusiveMatchError:
1846
1867
  return True
@@ -34,6 +34,37 @@ def response(status=200, payload=None, headers=None):
34
34
  return result
35
35
 
36
36
 
37
+ def test_project_secret_key_authenticates_management_requests():
38
+ page = {"count": 0, "next": None, "previous": None, "results": []}
39
+ tags = {"id": EXPERIMENT_ID, "tags": ["ci"]}
40
+ with (
41
+ OfflineEvaluations(project_id=123, secret_key="phs_example_only") as client,
42
+ patch.object(
43
+ requests.Session,
44
+ "send",
45
+ side_effect=[
46
+ response(payload=page),
47
+ response(payload=page),
48
+ response(payload=tags),
49
+ ],
50
+ ) as send,
51
+ ):
52
+ client.datasets.list()
53
+ client.scorers.list()
54
+ client.resume_experiment(EXPERIMENT_ID).set_tags(["ci"])
55
+
56
+ requests_sent = [call.args[0] for call in send.call_args_list]
57
+ assert [(req.method, req.path_url.split("?")[0]) for req in requests_sent] == [
58
+ ("GET", "/api/projects/123/datasets/"),
59
+ ("GET", "/api/projects/123/llm_analytics/score_definitions/"),
60
+ ("PATCH", f"{PATH}{EXPERIMENT_ID}/"),
61
+ ]
62
+ assert all(
63
+ req.headers["Authorization"] == "Bearer phs_example_only"
64
+ for req in requests_sent
65
+ )
66
+
67
+
37
68
  @pytest.fixture
38
69
  def transport():
39
70
  client = SyncTransport(123, "phx_test_secret")
@@ -357,13 +388,14 @@ def test_closed_client_does_not_send(transport):
357
388
 
358
389
 
359
390
  @pytest.mark.asyncio
360
- async def test_async_native_request_uses_auth_host_and_preserves_bytes():
391
+ @pytest.mark.parametrize("secret_key", ["phx_example_only", "phs_example_only"])
392
+ async def test_async_native_request_uses_auth_host_and_preserves_bytes(secret_key):
361
393
  seen = []
362
394
 
363
395
  async def handle(request):
364
396
  seen.append(request)
365
397
  if len(seen) == 1:
366
- raise httpx.ReadTimeout("phx_test_secret")
398
+ raise httpx.ReadTimeout(secret_key)
367
399
  return httpx.Response(201, json={"id": "stable-id"})
368
400
 
369
401
  real_client = httpx.AsyncClient
@@ -374,7 +406,7 @@ async def test_async_native_request_uses_auth_host_and_preserves_bytes():
374
406
  ),
375
407
  ) as factory:
376
408
  transport = AsyncTransport(
377
- 123, "phx_test_secret", host="https://eu.i.posthog.com", timeout=9
409
+ 123, secret_key, host="https://eu.i.posthog.com", timeout=9
378
410
  )
379
411
  with patch(
380
412
  "posthog.ai.evaluations._transport.asyncio.sleep", new_callable=AsyncMock
@@ -383,7 +415,7 @@ async def test_async_native_request_uses_auth_host_and_preserves_bytes():
383
415
  assert len(seen) == 2
384
416
  assert seen[0].content == seen[1].content == BODY
385
417
  assert str(seen[0].url) == "https://eu.posthog.com" + PATH
386
- assert seen[0].headers["Authorization"] == "Bearer phx_test_secret"
418
+ assert seen[0].headers["Authorization"] == f"Bearer {secret_key}"
387
419
  assert factory.call_args.kwargs["follow_redirects"] is False
388
420
  assert factory.call_args.kwargs["timeout"] == 9
389
421
  sleep.assert_awaited_once()