Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

Fixes #17479 , although as you can see in the test case the logic still remains far from perfect

Fixes python#17479 , although as you can see in the test case the logic still
remains far from perfect
@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

ddtrace:
fixes false positive in utils_redis.py
schema is because we have a nested dict, so inferring narrower types on the inner dicts means the outer dict becomes dict[str, object] instead of dict[str, dict[str, builtins.function]]
span_attribute_schema seems regrettable, let me see what i can do

prefect:
fixes false positive in profile.py
it's unclear to me how provisioners was working earlier, was it inferring a union? will look further

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja deleted the function-join branch January 3, 2025 09:28
@hauntsaninja hauntsaninja restored the function-join branch December 30, 2025 01:04
@hauntsaninja hauntsaninja reopened this Dec 30, 2025
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/profile.py:180: error: Cannot call function of unknown type  [operator]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/internal/schema/__init__.py:43: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:44: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:45: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:46: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:47: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:48: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:49: error: Value of type "object" is not indexable  [index]
+ ddtrace/internal/schema/__init__.py:50: error: Value of type "object" is not indexable  [index]
+ ddtrace/_trace/utils_valkey.py:35: error: Unused "type: ignore" comment  [unused-ignore]

@hauntsaninja hauntsaninja marked this pull request as ready for review December 30, 2025 03:03
@hauntsaninja
Copy link
Collaborator Author

Fixed some stuff, this looks good now. Fixes two false positives. Better inference leads to one new false positive, but really it should have an annotation and it will make subsequent inference for calls better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(🐞) overlapping Callables are incorrectly joined into builtins.function

1 participant