-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
refactor: Support type checking from cache_for
decorator
#26052
base: master
Are you sure you want to change the base?
Changes from all commits
77fa7ee
330d1aa
fa54a57
7d4778c
a8607b7
bd01311
1af66ee
5a66d54
73fd962
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -333,12 +333,14 @@ ee/billing/billing_manager.py:0: error: Incompatible types in assignment (expres | |||||||||||||
posthog/models/property/util.py:0: error: Incompatible type for lookup 'pk': (got "str | int | list[str]", expected "str | int") [misc] | ||||||||||||||
posthog/models/property/util.py:0: error: Argument 3 to "format_filter_query" has incompatible type "HogQLContext | None"; expected "HogQLContext" [arg-type] | ||||||||||||||
posthog/models/property/util.py:0: error: Argument 3 to "format_cohort_subquery" has incompatible type "HogQLContext | None"; expected "HogQLContext" [arg-type] | ||||||||||||||
posthog/models/property/util.py:0: error: Invalid index type "tuple[str, str]" for "dict[tuple[str, Literal['properties', 'group_properties', 'person_properties']], str]"; expected type "tuple[str, Literal['properties', 'group_properties', 'person_properties']]" [index] | ||||||||||||||
posthog/models/property/util.py:0: error: Argument 1 to "append" of "list" has incompatible type "str | int"; expected "str" [arg-type] | ||||||||||||||
posthog/models/property/util.py:0: error: Argument 1 to "append" of "list" has incompatible type "str | int"; expected "str" [arg-type] | ||||||||||||||
posthog/models/property/util.py:0: error: Argument 1 to "append" of "list" has incompatible type "str | int"; expected "str" [arg-type] | ||||||||||||||
posthog/api/utils.py:0: error: Incompatible types in assignment (expression has type "type[EventDefinition]", variable has type "type[EnterpriseEventDefinition]") [assignment] | ||||||||||||||
posthog/api/utils.py:0: error: Argument 1 to "UUID" has incompatible type "int | str"; expected "str | None" [arg-type] | ||||||||||||||
posthog/queries/trends/util.py:0: error: Argument 1 to "translate_hogql" has incompatible type "str | None"; expected "str" [arg-type] | ||||||||||||||
posthog/queries/column_optimizer/foss_column_optimizer.py:0: error: Argument 1 to "get" of "dict" has incompatible type "tuple[str, str]"; expected "tuple[str, Literal['properties', 'group_properties', 'person_properties']]" [arg-type] | ||||||||||||||
posthog/hogql/property.py:0: error: Incompatible type for lookup 'id': (got "str | int | list[str]", expected "str | int") [misc] | ||||||||||||||
posthog/hogql/property.py:0: error: Incompatible type for lookup 'pk': (got "str | float", expected "str | int") [misc] | ||||||||||||||
posthog/api/capture.py:0: error: Module has no attribute "utc" [attr-defined] | ||||||||||||||
|
@@ -599,6 +601,9 @@ posthog/api/organization_feature_flag.py:0: error: Invalid index type "str | Non | |||||||||||||
posthog/api/organization_feature_flag.py:0: error: Invalid index type "str | None" for "dict[str, int]"; expected type "str" [index] | ||||||||||||||
posthog/api/organization_feature_flag.py:0: error: Invalid index type "str | None" for "dict[str, int]"; expected type "str" [index] | ||||||||||||||
posthog/api/notebook.py:0: error: Incompatible types in assignment (expression has type "int", variable has type "str | None") [assignment] | ||||||||||||||
posthog/year_in_posthog/year_in_posthog.py:0: error: Item "None" of "dict[Any, Any] | None" has no attribute "get" [union-attr] | ||||||||||||||
posthog/year_in_posthog/year_in_posthog.py:0: error: Argument 1 to "stats_for_user" has incompatible type "dict[Any, Any] | None"; expected "dict[Any, Any]" [arg-type] | ||||||||||||||
posthog/year_in_posthog/year_in_posthog.py:0: error: Item "None" of "dict[Any, Any] | None" has no attribute "get" [union-attr] | ||||||||||||||
Comment on lines
+604
to
+606
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are already "handled" here and don't want to fix them posthog/posthog/year_in_posthog/year_in_posthog.py Lines 130 to 135 in ff2271b
|
||||||||||||||
posthog/warehouse/external_data_source/source.py:0: error: Incompatible types in assignment (expression has type "int", target has type "str") [assignment] | ||||||||||||||
posthog/warehouse/external_data_source/source.py:0: error: Incompatible types in assignment (expression has type "int", target has type "str") [assignment] | ||||||||||||||
posthog/warehouse/external_data_source/source.py:0: error: Incompatible types in assignment (expression has type "dict[str, Collection[str]]", variable has type "StripeSourcePayload") [assignment] | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,8 +69,8 @@ def materialize_session_and_window_id(database): | |
# materialized the column or renamed the column, and then ran the 0004_... async migration | ||
# before this migration runs. | ||
possible_old_column_names = {"mat_" + property_name} | ||
current_materialized_column_name = materialized_columns.get(property_name, None) | ||
if current_materialized_column_name != property_name: | ||
current_materialized_column_name = materialized_columns.get((property_name, "properties"), None) | ||
if current_materialized_column_name is not None and current_materialized_column_name != property_name: | ||
Comment on lines
+72
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been broken for a while |
||
possible_old_column_names.add(current_materialized_column_name) | ||
|
||
for possible_old_column_name in possible_old_column_names: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't particularly problematic and trying to fix them just moves the errors up the stack to all the call sites instead and don't want to deal with them right now