Skip to content

fix(exports): condition the export of definitions under TYPE_CHECKING#3630

Open
rexledesma wants to merge 1 commit into
facebook:mainfrom
rexledesma:rl/no-exports-from-typechecking
Open

fix(exports): condition the export of definitions under TYPE_CHECKING#3630
rexledesma wants to merge 1 commit into
facebook:mainfrom
rexledesma:rl/no-exports-from-typechecking

Conversation

@rexledesma
Copy link
Copy Markdown
Contributor

@rexledesma rexledesma commented Jun 1, 2026

Summary

Fixes #3629

Test Plan

cargo test

@meta-cla meta-cla Bot added the cla signed label Jun 1, 2026
@github-actions github-actions Bot added the size/m label Jun 1, 2026
Comment on lines +113 to +115
/// True while every definition site is inside an `if TYPE_CHECKING:` body.
/// Such names resolve in-module but are not importable at runtime.
pub type_checking_only: bool,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could probably have a better diff to squash the problem of " no conditional exports", which would also address #3624, but want to keep this diff scoped to get immediate feedback first ✌️

@github-actions

This comment has been minimized.

@rexledesma rexledesma force-pushed the rl/no-exports-from-typechecking branch from 0ce7ccb to 5a3cf14 Compare June 1, 2026 19:40
@github-actions github-actions Bot added size/m and removed size/m labels Jun 1, 2026
@jorenham
Copy link
Copy Markdown
Contributor

jorenham commented Jun 1, 2026

The primer errors are probably related to my comment at #3629 (comment)

@rexledesma rexledesma force-pushed the rl/no-exports-from-typechecking branch from 5a3cf14 to 4617696 Compare June 1, 2026 19:44
@github-actions github-actions Bot added size/m and removed size/m labels Jun 1, 2026
@github-actions

This comment has been minimized.

@rexledesma rexledesma force-pushed the rl/no-exports-from-typechecking branch from bbc4d0e to ad8fd85 Compare June 1, 2026 22:52
@github-actions github-actions Bot added size/m and removed size/m labels Jun 1, 2026
@rexledesma rexledesma force-pushed the rl/no-exports-from-typechecking branch from ad8fd85 to 6edf11e Compare June 1, 2026 23:04
@github-actions github-actions Bot added size/l and removed size/m labels Jun 1, 2026
@rexledesma rexledesma changed the title fix(exports): do not export definitions under TYPE_CHECKING fix(exports): condition the export of definitions under TYPE_CHECKING Jun 1, 2026
@rexledesma
Copy link
Copy Markdown
Contributor Author

@jorenham hmm ok I guess that's fine. I'm not a fan of these re-exports in the TYPE_CHECKING block because it adds some indirection around the source of source for these type annotations.

I'll switch my implementation to be more liberal about the exports here, but maybe we can have a rule to emit a warning/error for this sort of indirection?

@jorenham
Copy link
Copy Markdown
Contributor

jorenham commented Jun 1, 2026

but maybe we can have a rule to emit a warning/error for this sort of indirection?

feels more like a job for a linter like ruff tbh; it's unrelated to type-safety, after all.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

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

cloud-init (https://github.com/canonical/cloud-init)
+ ERROR cloudinit/config/cc_ansible.py:15:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_apk_configure.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_apt_configure.py:23:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_apt_pipelining.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_bootcmd.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_byobu.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ca_certs.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_chef.py:21:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_disable_ec2_metadata.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_disk_setup.py:19:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_fan.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_final_message.py:15:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_growpart.py:26:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_grub_dpkg.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_install_hotplug.py:9:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_keyboard.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_keys_to_console.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_landscape.py:19:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_locale.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_lxd.py:18:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_mcollective.py:23:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_mounts.py:22:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ntp.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_package_update_upgrade_install.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_phone_home.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_power_state_change.py:19:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_puppet.py:23:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_raspberry_pi.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_reset_rmc.py:33:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_resizefs.py:21:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_resolv_conf.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_rh_subscription.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_rsyslog.py:22:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_runcmd.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_salt_minion.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_scripts_per_boot.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_scripts_per_instance.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_scripts_per_once.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_scripts_user.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_scripts_vendor.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_seed_random.py:18:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_set_hostname.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_set_passwords.py:19:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_snap.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_spacewalk.py:9:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ssh.py:20:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ssh_authkey_fingerprints.py:15:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ssh_import_id.py:18:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_timezone.py:15:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ubuntu_autoinstall.py:11:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ubuntu_drivers.py:22:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_ubuntu_pro.py:14:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_update_etc_hosts.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_update_hostname.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_users_groups.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_wireguard.py:12:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_write_files.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_write_files_deferred.py:13:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_yum_add_repo.py:17:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR cloudinit/config/cc_zypper_add_repo.py:16:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
+ ERROR tests/integration_tests/assets/dropins/cc_custom_module_24_1.py:10:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]
- ERROR tests/integration_tests/assets/dropins/cc_custom_module_24_1.py:24:5-11: Key `name` is not defined in TypedDict `MetaSchema` [bad-typed-dict-key]
- ERROR tests/integration_tests/assets/dropins/cc_custom_module_24_1.py:25:5-12: Key `title` is not defined in TypedDict `MetaSchema` [bad-typed-dict-key]
- ERROR tests/integration_tests/assets/dropins/cc_custom_module_24_1.py:26:5-18: Key `description` is not defined in TypedDict `MetaSchema` [bad-typed-dict-key]
- ERROR tests/integration_tests/assets/dropins/cc_custom_module_24_1.py:30:5-15: Key `examples` is not defined in TypedDict `MetaSchema` [bad-typed-dict-key]
+ ERROR tests/unittests/config/test_modules.py:15:37-47: Could not import `MetaSchema` from `cloudinit.config.schema` [missing-module-attribute]

mkosi (https://github.com/systemd/mkosi)
+ ERROR mkosi/__init__.py:120:5-10: Could not import `Popen` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/bootloader.py:33:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/installer/apk.py:13:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/installer/apt.py:13:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/installer/dnf.py:13:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/installer/pacman.py:15:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]
+ ERROR mkosi/installer/zypper.py:12:23-39: Could not import `CompletedProcess` from `mkosi.run` [missing-module-attribute]

steam.py (https://github.com/Gobot1234/steam.py)
+ ERROR steam/client.py:1356:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/client.py:1360:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/client.py:1364:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/client.py:1368:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/ext/csgo/models.py:190:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/ext/tf2/types/schema.py:25:5-16: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:48:5-23: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:49:5-24: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:52:5-19: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:66:5-23: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:71:5-16: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:78:5-17: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/ext/tf2/types/schema.py:90:5-19: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/tag.py:82:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/tag.py:114:6-16: No attribute `todo` in module `steam.utils` [missing-attribute]
+ ERROR steam/types/achievement.py:49:5-14: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/achievement.py:50:5-14: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/achievement.py:57:5-13: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:19:5-13: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:30:5-9: `Required` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:31:5-9: `Required` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:278:5-8: `Required` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:285:5-11: `Required` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:298:5-16: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:299:5-16: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:314:5-23: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:315:5-41: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:316:5-32: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:320:5-14: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:321:5-15: `NotRequired` may only be used for TypedDict members [invalid-annotation]
+ ERROR steam/types/manifest.py:322:5-14: `NotRequired` may only be used for TypedDict members [invalid-annotation]

jax (https://github.com/google/jax)
+ ERROR jax/_src/ad_checkpoint.py:51:71-79: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/ad_checkpoint.py:52:28-36: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/ad_util.py:26:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/api.py:74:35-43: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/api.py:74:45-53: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/api_util.py:34:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/api_util.py:34:67-75: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/array.py:51:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/callback.py:53:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/callback.py:54:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/checkify.py:53:40-48: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/checkify.py:53:50-58: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/checkify.py:54:64-71: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/compute_on.py:28:28-36: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/compute_on.py:28:38-46: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/compute_on.py:31:40-60: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/core.py:52:28-36: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/core.py:52:38-46: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/core.py:55:28-35: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/custom_batching.py:43:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/custom_batching.py:44:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/custom_derivatives.py:46:35-43: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/custom_derivatives.py:46:45-53: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/debugging.py:82:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/dispatch.py:72:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/dispatch.py:73:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/earray.py:25:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/earray.py:25:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/export/_export.py:47:40-60: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/export/_export.py:63:7-20: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/export/_export.py:64:7-20: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/ffi.py:42:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/flatten_util.py:23:27-42: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/hijax.py:42:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/hijax.py:42:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/internal_test_util/lax_test_util.py:30:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/internal_test_util/lax_test_util.py:30:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/ad.py:41:36-44: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/ad.py:41:46-54: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/ad.py:43:28-35: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/batching.py:35:36-44: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/batching.py:35:46-54: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/mlir.py:55:40-60: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/interpreters/mlir.py:63:27-34: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/mlir.py:67:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/interpreters/mlir.py:68:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/interpreters/mlir.py:632:3-16: No attribute `mhlo` in module `jax._src.lib.mlir.dialects` [missing-attribute]
+ ERROR jax/_src/interpreters/mlir.py:633:3-16: No attribute `chlo` in module `jax._src.lib.mlir.dialects` [missing-attribute]
+ ERROR jax/_src/interpreters/partial_eval.py:47:36-44: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/partial_eval.py:47:46-54: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/partial_eval.py:50:39-46: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/pxla.py:66:28-36: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/pxla.py:66:38-46: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/remat.py:22:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/interpreters/remat.py:22:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/jaxpr_util.py:40:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/jaxpr_util.py:41:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/lax/ann.py:87:40-44: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/common.py:34:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/conditionals.py:47:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/conditionals.py:47:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/loops.py:67:40-44: Could not import `chlo` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/loops.py:80:34-42: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/loops.py:80:44-52: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/control_flow/solves.py:33:39-47: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/convolution.py:1029:10-23: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/lax/eval_jaxpr.py:22:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/eval_jaxpr.py:22:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/lax.py:66:40-44: Could not import `chlo` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/lax/lax.py:73:28-36: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/lax.py:73:38-46: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/lax.py:74:28-35: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/linalg.py:51:40-44: Could not import `chlo` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/lax/parallel.py:49:57-65: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/parallel.py:49:67-75: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/slicing.py:53:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/slicing.py:53:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/special.py:38:40-44: Could not import `chlo` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/lax/utils.py:31:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/lax/windowed_reductions.py:43:7-20: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/lax/windowed_reductions.py:44:7-20: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/mesh.py:33:28-36: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/array_methods.py:55:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/array_methods.py:55:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/fft.py:25:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/indexing.py:50:46-54: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/lax_numpy.py:67:20-28: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/util.py:30:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/util.py:30:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/vectorize.py:28:39-54: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/numpy/vectorize.py:28:56-71: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/core.py:64:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/core.py:65:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/cost_estimate.py:30:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/cost_estimate.py:31:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/fuser/custom_evaluate.py:57:3-16: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/custom_evaluate.py:58:3-16: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/custom_evaluate.py:75:12-25: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/custom_evaluate.py:78:7-20: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/custom_evaluate.py:82:10-23: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/custom_fusion_lib.py:264:10-23: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/fusible.py:125:22-35: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/fusible_dtype.py:44:27-34: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/fuser/fusible_dtype.py:46:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/fusible_dtype.py:47:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/fuser/fusion.py:26:12-25: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/hlo_interpreter.py:50:5-12: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/hlo_interpreter.py:51:5-13: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/hlo_interpreter.py:52:5-13: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/core.py:38:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/core.py:39:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:51:5-13: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:52:5-13: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/interpret/utils.py:26:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:57:40-45: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:58:40-42: Could not import `cf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:59:40-44: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:60:40-57: Could not import `math` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:61:40-46: Could not import `memref` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:62:40-43: Could not import `scf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:63:40-46: Could not import `vector` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:77:27-34: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:78:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/lowering.py:79:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/primitives.py:45:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/primitives.py:46:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_lowering.py:28:40-45: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_lowering.py:29:40-46: Could not import `memref` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_lowering.py:30:40-46: Could not import `vector` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_lowering.py:42:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_lowering.py:43:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_primitives.py:32:40-45: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_primitives.py:33:40-43: Could not import `scf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic/sc_primitives.py:34:40-46: Could not import `vector` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/interpret/interpret_pallas_call.py:31:28-36: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/interpret/jaxpr_interpret.py:34:28-36: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:48:40-62: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:49:40-56: Could not import `cf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:50:40-58: Could not import `gpu` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:51:40-60: Could not import `llvm` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:52:40-60: Could not import `math` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:53:40-64: Could not import `memref` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:54:40-60: Could not import `nvvm` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:55:40-58: Could not import `scf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:56:40-64: Could not import `vector` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:67:27-34: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:76:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/lowering.py:77:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/pipeline.py:42:7-20: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/pipeline.py:43:7-20: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/primitives.py:38:40-62: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/primitives.py:39:40-66: Could not import `builtin` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/primitives.py:40:40-58: Could not import `gpu` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/primitives.py:41:40-60: Could not import `nvvm` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/primitives.py:42:40-64: Could not import `vector` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/mosaic_gpu/torch.py:32:40-44: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/pallas_call.py:53:5-13: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/pallas_call.py:54:5-13: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/primitives.py:57:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/primitives.py:58:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:44:40-62: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:45:40-60: Could not import `math` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:46:40-58: Could not import `scf` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:53:27-34: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:60:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/triton/lowering.py:61:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pallas/triton/primitives.py:30:40-62: Could not import `arith` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pallas/triton/primitives.py:31:40-58: Could not import `gpu` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pjit.py:61:40-60: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/_src/pjit.py:78:23-31: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pjit.py:78:33-41: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/pmap.py:49:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/pmap.py:50:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/random/prng.py:52:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/random/prng.py:52:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/scipy/ndimage.py:28:27-42: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/scipy/sparse/linalg.py:31:27-42: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/shard_alike.py:25:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/shard_map.py:63:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/shard_map.py:64:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/sharding.py:20:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/stages.py:61:19-32: No attribute `safe_map` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/stages.py:62:19-32: No attribute `safe_zip` in module `jax._src.util` [missing-attribute]
+ ERROR jax/_src/state/discharge.py:46:28-35: Could not import `foreach` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/discharge.py:46:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/discharge.py:46:47-55: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/primitives.py:49:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/primitives.py:49:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/types.py:34:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/types.py:34:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/utils.py:28:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/state/utils.py:28:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/_src/tree_util.py:28:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/example_libraries/optimizers.py:102:27-35: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/example_libraries/optimizers.py:102:37-45: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/experimental/fused.py:20:27-35: Could not import `safe_map` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/experimental/fused.py:20:37-45: Could not import `safe_zip` from `jax._src.util` [missing-module-attribute]
+ ERROR jax/experimental/jax2tf/call_tf.py:46:40-60: Could not import `func` from `jax._src.lib.mlir.dialects` [missing-module-attribute]
+ ERROR jax/experimental/jax2tf/call_tf.py:56:7-20: No attribute `safe_map` in module `jax._src.util` [missing-attribute]

... (truncated 42 lines) ...

spark (https://github.com/apache/spark)
+ ERROR python/pyspark/pandas/resample.py:374:40-49: Argument `Index` is not assignable to parameter `origin` with type `Timestamp` in function `Resampler._bin_timestamp` [bad-argument-type]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_assign_frame.py:172:9-38: Cannot set item in `DataFrame` [unsupported-operation]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_aggregate.py:115:20-77: Argument `list[tuple[str, str, str]]` is not assignable to parameter `by` with type `Sequence[str] | str` in function `pandas.core.frame.DataFrame.sort_values` [bad-argument-type]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:52:60-84: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:52:60-84: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:60:17-48: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:60:17-48: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:64:17-41: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:64:17-41: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:72:17-48: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:72:17-48: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:76:17-41: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:76:17-41: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:84:17-48: Expected a callable, got `SeriesGroupBy[Any, int]` [not-callable]
+ ERROR python/pyspark/pandas/tests/diff_frames_ops/test_groupby_fillna.py:84:17-48: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/diff_frames_ops/test_index.py:84:9-38: Cannot set item in `DataFrame` [unsupported-operation]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:41:59-82: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:41:59-82: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:49:17-47: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:49:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:53:17-40: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:53:17-40: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:61:17-47: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:61:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:65:17-40: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:65:17-40: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:73:17-47: Expected a callable, got `SeriesGroupBy[Any, Scalar]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:73:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:77:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:85:17-54: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:89:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:97:17-54: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:129:17-47: Expected a callable, got `SeriesGroupBy[Any, tuple[Hashable, ...]]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:129:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:133:17-47: Expected a callable, got `SeriesGroupBy[Any, tuple[Hashable, ...]]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:133:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:137:17-47: Expected a callable, got `SeriesGroupBy[Any, tuple[Hashable, ...]]` [not-callable]
+ ERROR python/pyspark/pandas/tests/groupby/test_missing_data.py:137:17-47: Expected a callable, got `SeriesGroupBy[Any]` [not-callable]
- ERROR python/pyspark/pandas/tests/indexes/test_indexing_loc_2d.py:92:44-61: Cannot index into `_LocIndexerFrame[DataFrame]` [bad-index]
- ERROR python/pyspark/pandas/tests/indexes/test_indexing_loc_2d.py:93:44-61: Cannot index into `_LocIndexerFrame[DataFrame]` [bad-index]
+ ERROR python/pyspark/testing/pandasutils.py:468:48-87: No matching overload found for function `pandas.core.frame.DataFrame.sort_values` called with arguments: (by=Index[str], ignore_index=Literal[True]) [no-matching-overload]
+ ERROR python/pyspark/testing/pandasutils.py:470:50-90: No matching overload found for function `pandas.core.frame.DataFrame.sort_values` called with arguments: (by=Index[str], ignore_index=Literal[True]) [no-matching-overload]

prefect (https://github.com/PrefectHQ/prefect)
- ERROR src/prefect/server/api/artifacts.py:34:16-54: `Artifact` is not assignable to variable `artifact` with type `ArtifactCreate` [bad-assignment]
- ERROR src/prefect/server/api/artifacts.py:41:22-30: Argument `ArtifactCreate` is not assignable to parameter `artifact` with type `Artifact` in function `prefect.server.models.artifacts.create_artifact` [bad-argument-type]
- ERROR src/prefect/server/api/artifacts.py:46:12-17: Returned type `prefect.server.database.orm_models.Artifact` is not assignable to declared return type `prefect.server.schemas.core.Artifact` [bad-return]
- ERROR src/prefect/server/api/artifacts.py:66:12-20: Returned type `prefect.server.database.orm_models.Artifact` is not assignable to declared return type `prefect.server.schemas.core.Artifact` [bad-return]
- ERROR src/prefect/server/api/artifacts.py:85:12-20: Returned type `ArtifactCollection` is not assignable to declared return type `Artifact` [bad-return]
- ERROR src/prefect/server/api/artifacts.py:93:41-45: Default `None` is not assignable to parameter `artifacts` with type `ArtifactFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:94:40-44: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:95:40-44: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:96:33-37: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:97:45-49: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:104:16-114:10: Returned type `Sequence[prefect.server.database.orm_models.Artifact]` is not assignable to declared return type `list[prefect.server.schemas.core.Artifact]` [bad-return]
- ERROR src/prefect/server/api/artifacts.py:122:51-55: Default `None` is not assignable to parameter `artifacts` with type `ArtifactCollectionFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:123:40-44: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:124:40-44: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:125:33-37: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:126:45-49: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:133:16-143:10: Returned type `Sequence[prefect.server.database.orm_models.ArtifactCollection]` is not assignable to declared return type `list[prefect.server.schemas.core.ArtifactCollection]` [bad-return]
- ERROR src/prefect/server/api/artifacts.py:148:41-45: Default `None` is not assignable to parameter `artifacts` with type `ArtifactFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:149:40-44: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:150:40-44: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:151:33-37: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:152:45-49: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:171:51-55: Default `None` is not assignable to parameter `artifacts` with type `ArtifactCollectionFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:172:40-44: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:173:40-44: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:174:33-37: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/artifacts.py:175:45-49: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/block_documents.py:81:18-22: Argument `BlockDocumentSort | None` is not assignable to parameter `sort` with type `BlockDocumentSort` in function `prefect.server.models.block_documents.read_block_documents` [bad-argument-type]
- ERROR src/prefect/server/api/block_schemas.py:69:16-21: Returned type `prefect.server.schemas.core.BlockSchema | prefect.server.database.orm_models.BlockSchema` is not assignable to declared return type `prefect.server.schemas.core.BlockSchema` [bad-return]
- ERROR src/prefect/server/api/block_schemas.py:90:12-48: Object of class `NoneType` has no attribute `is_protected` [missing-attribute]
- ERROR src/prefect/server/api/block_types.py:36:37-47: Argument `BlockTypeCreate` is not assignable to parameter `block_type` with type `prefect.server.schemas.core.BlockType | prefect.client.schemas.objects.BlockType` in function `prefect.server.models.block_types.create_block_type` [bad-argument-type]
- ERROR src/prefect/server/api/block_types.py:43:12-30: Returned type `prefect.server.database.orm_models.BlockType | None` is not assignable to declared return type `prefect.server.schemas.core.BlockType` [bad-return]
- ERROR src/prefect/server/api/block_types.py:60:12-22: Returned type `prefect.server.database.orm_models.BlockType` is not assignable to declared return type `prefect.server.schemas.core.BlockType` [bad-return]
- ERROR src/prefect/server/api/block_types.py:77:12-22: Returned type `prefect.server.database.orm_models.BlockType` is not assignable to declared return type `prefect.server.schemas.core.BlockType` [bad-return]
- ERROR src/prefect/server/api/block_types.py:92:16-98:10: Returned type `Sequence[prefect.server.database.orm_models.BlockType]` is not assignable to declared return type `list[prefect.server.schemas.core.BlockType]` [bad-return]
- ERROR src/prefect/server/api/block_types.py:124:13-23: Argument `BlockTypeUpdate` is not assignable to parameter `local_block_type` with type `BlockType` in function `prefect.blocks.core._should_update_block_type` [bad-argument-type]
- ERROR src/prefect/server/api/block_types.py:125:13-87: Argument `prefect.server.schemas.core.BlockType` is not assignable to parameter `server_block_type` with type `prefect.client.schemas.objects.BlockType` in function `prefect.blocks.core._should_update_block_type` [bad-argument-type]
- ERROR src/prefect/server/api/concurrency_limits.py:144:12-17: Returned type `prefect.server.database.orm_models.ConcurrencyLimit` is not assignable to declared return type `prefect.server.schemas.core.ConcurrencyLimit` [bad-return]
- ERROR src/prefect/server/api/concurrency_limits.py:187:12-20: Returned type `prefect.server.database.orm_models.ConcurrencyLimit` is not assignable to declared return type `prefect.server.schemas.core.ConcurrencyLimit` [bad-return]
- ERROR src/prefect/server/api/concurrency_limits.py:237:12-45: Returned type `list[prefect.server.schemas.core.ConcurrencyLimit | prefect.server.database.orm_models.ConcurrencyLimit]` is not assignable to declared return type `Sequence[prefect.server.schemas.core.ConcurrencyLimit]` [bad-return]
- ERROR src/prefect/server/api/deployments.py:163:22-64: `Deployment` is not assignable to variable `deployment` with type `DeploymentCreate` [bad-assignment]
- ERROR src/prefect/server/api/deployments.py:300:36-40: `None` is not assignable to attribute `schedules` with type `list[DeploymentScheduleUpdate]` [bad-assignment]
- ERROR src/prefect/server/api/deployments.py:951:20-973:10: `FlowRun` is not assignable to variable `flow_run` with type `DeploymentFlowRunCreate` [bad-assignment]
- ERROR src/prefect/server/api/deployments.py:980:39-47: Argument `DeploymentFlowRunCreate` is not assignable to parameter `flow_run` with type `FlowRun` in function `prefect.server.models.flow_runs.create_flow_run` [bad-argument-type]
- ERROR src/prefect/server/api/deployments.py:1231:12-23: Returned type `Sequence[prefect.server.database.orm_models.WorkQueue]` is not assignable to declared return type `list[prefect.server.schemas.core.WorkQueue]` [bad-return]
+ ERROR src/prefect/server/api/deployments.py:1231:12-23: Returned type `Sequence[WorkQueue]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/flow_run_states.py:40:12-26: Returned type `FlowRunState` is not assignable to declared return type `State` [bad-return]
- ERROR src/prefect/server/api/flow_run_states.py:52:16-54:10: Returned type `Sequence[FlowRunState]` is not assignable to declared return type `list[State]` [bad-return]
+ ERROR src/prefect/server/api/flow_run_states.py:52:16-54:10: Returned type `Sequence[FlowRunState]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/flows.py:37:12-50: `Flow` is not assignable to variable `flow` with type `FlowCreate` [bad-assignment]
- ERROR src/prefect/server/api/flows.py:42:70-74: Argument `FlowCreate` is not assignable to parameter `flow` with type `Flow` in function `prefect.server.models.flows.create_flow` [bad-argument-type]
- ERROR src/prefect/server/api/flows.py:46:12-17: Returned type `prefect.server.database.orm_models.Flow` is not assignable to declared return type `prefect.server.schemas.core.Flow` [bad-return]
- ERROR src/prefect/server/api/flows.py:70:41-45: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:71:48-52: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:72:48-52: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:73:53-57: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:74:50-54: Default `None` is not assignable to parameter `work_pools` with type `WorkPoolFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:105:12-16: Returned type `prefect.server.database.orm_models.Flow` is not assignable to declared return type `prefect.server.schemas.core.Flow` [bad-return]
- ERROR src/prefect/server/api/flows.py:122:12-16: Returned type `prefect.server.database.orm_models.Flow` is not assignable to declared return type `prefect.server.schemas.core.Flow` [bad-return]
- ERROR src/prefect/server/api/flows.py:129:41-45: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:130:48-52: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:131:48-52: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:132:53-57: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:133:50-54: Default `None` is not assignable to parameter `work_pools` with type `WorkPoolFilter` [bad-function-definition]
- ERROR src/prefect/server/api/flows.py:141:16-151:10: Returned type `Sequence[prefect.server.database.orm_models.Flow]` is not assignable to declared return type `list[prefect.server.schemas.core.Flow]` [bad-return]
+ ERROR src/prefect/server/api/flows.py:141:16-151:10: Returned type `Sequence[Flow]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/run_history.py:159:14-42: Type `Result[tuple[Any, Any, Unknown]]` is not awaitable [not-async]
+ ERROR src/prefect/server/api/run_history.py:159:14-42: Type `Result[Any]` is not awaitable [not-async]
- ERROR src/prefect/server/api/saved_searches.py:33:20-73: `SavedSearch` is not assignable to variable `saved_search` with type `SavedSearchCreate` [bad-assignment]
- ERROR src/prefect/server/api/saved_searches.py:39:43-55: Argument `SavedSearchCreate` is not assignable to parameter `saved_search` with type `SavedSearch` in function `prefect.server.models.saved_searches.create_saved_search` [bad-argument-type]
- ERROR src/prefect/server/api/saved_searches.py:45:12-17: Returned type `prefect.server.database.orm_models.SavedSearch` is not assignable to declared return type `prefect.server.schemas.core.SavedSearch` [bad-return]
- ERROR src/prefect/server/api/saved_searches.py:64:12-24: Returned type `prefect.server.database.orm_models.SavedSearch` is not assignable to declared return type `prefect.server.schemas.core.SavedSearch` [bad-return]
- ERROR src/prefect/server/api/saved_searches.py:77:16-81:10: Returned type `Sequence[prefect.server.database.orm_models.SavedSearch]` is not assignable to declared return type `list[prefect.server.schemas.core.SavedSearch]` [bad-return]
+ ERROR src/prefect/server/api/saved_searches.py:77:16-81:10: Returned type `Sequence[SavedSearch]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/task_run_states.py:40:12-26: Returned type `TaskRunState` is not assignable to declared return type `State` [bad-return]
- ERROR src/prefect/server/api/task_run_states.py:52:16-54:10: Returned type `Sequence[TaskRunState]` is not assignable to declared return type `list[State]` [bad-return]
+ ERROR src/prefect/server/api/task_run_states.py:52:16-54:10: Returned type `Sequence[TaskRunState]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/task_runs.py:73:16-53: `TaskRun` is not assignable to variable `task_run` with type `TaskRunCreate` [bad-assignment]
- ERROR src/prefect/server/api/task_runs.py:83:22-30: Argument `TaskRunCreate` is not assignable to parameter `task_run` with type `TaskRun` in function `prefect.server.models.task_runs.create_task_run` [bad-argument-type]
- ERROR src/prefect/server/api/task_runs.py:115:41-45: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:116:48-52: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:117:48-52: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:118:53-57: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:146:41-45: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:147:48-52: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:148:48-52: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:149:53-57: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/task_runs.py:191:12-20: Returned type `prefect.server.database.orm_models.TaskRun` is not assignable to declared return type `prefect.server.schemas.core.TaskRun` [bad-return]
- ERROR src/prefect/server/api/task_runs.py:209:16-218:10: Returned type `Sequence[prefect.server.database.orm_models.TaskRun]` is not assignable to declared return type `list[prefect.server.schemas.core.TaskRun]` [bad-return]
+ ERROR src/prefect/server/api/task_runs.py:209:16-218:10: Returned type `Sequence[TaskRun]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/ui/flow_runs.py:54:41-45: Default `None` is not assignable to parameter `flows` with type `FlowFilter` [bad-function-definition]
- ERROR src/prefect/server/api/ui/flow_runs.py:55:48-52: Default `None` is not assignable to parameter `flow_runs` with type `FlowRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/ui/flow_runs.py:56:48-52: Default `None` is not assignable to parameter `task_runs` with type `TaskRunFilter` [bad-function-definition]
- ERROR src/prefect/server/api/ui/flow_runs.py:57:53-57: Default `None` is not assignable to parameter `deployments` with type `DeploymentFilter` [bad-function-definition]
- ERROR src/prefect/server/api/ui/flow_runs.py:58:50-54: Default `None` is not assignable to parameter `work_pools` with type `WorkPoolFilter` [bad-function-definition]
- ERROR src/prefect/server/api/ui/flow_runs.py:73:21-28: Argument `list[InstrumentedAttribute[StateType | None] | InstrumentedAttribute[Unknown | None] | InstrumentedAttribute[UUID] | InstrumentedAttribute[timedelta]]` is not assignable to parameter `columns` with type `list[str] | None` in function `prefect.server.models.flow_runs.read_flow_runs` [bad-argument-type]
- ERROR src/prefect/server/api/variables.py:110:16-116:10: Returned type `Sequence[prefect.server.database.orm_models.Variable]` is not assignable to declared return type `list[prefect.server.schemas.core.Variable]` [bad-return]
- ERROR src/prefect/server/api/work_queues.py:190:16-25: Returned type `Sequence[FlowRun]` is not assignable to declared return type `list[FlowRunResponse]` [bad-return]
+ ERROR src/prefect/server/api/work_queues.py:190:16-25: Returned type `Sequence[FlowRun]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/work_queues.py:209:12-21: Returned type `Sequence[FlowRun]` is not assignable to declared return type `list[FlowRunResponse]` [bad-return]
+ ERROR src/prefect/server/api/work_queues.py:209:12-21: Returned type `Sequence[FlowRun]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/workers.py:840:12-26: Returned type `Sequence[WorkerFlowRunResponse]` is not assignable to declared return type `list[WorkerFlowRunResponse]` [bad-return]
+ ERROR src/prefect/server/api/workers.py:840:12-26: Returned type `Sequence[Unknown]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/api/workers.py:935:52-56: Default `None` is not assignable to parameter `work_queues` with type `WorkQueueFilter` [bad-function-definition]
- ERROR src/prefect/server/api/workers.py:1166:16-1172:10: Returned type `Sequence[Worker]` is not assignable to declared return type `list[WorkerResponse]` [bad-return]
+ ERROR src/prefect/server/api/workers.py:1166:16-1172:10: Returned type `Sequence[Worker]` is not assignable to declared return type `list[Unknown]` [bad-return]
- ERROR src/prefect/server/models/deployments.py:155:74-84: Argument `Deployment | DeploymentCreate` is not assignable to parameter `deployment` with type `Deployment` in function `with_system_labels_for_deployment` [bad-argument-type]
- ERROR src/prefect/server/models/workers.py:986:55-81: `int` is not assignable to dict key `heartbeat_interval_seconds` with type `WorkerStatus | datetime` [bad-assignment]
- ERROR src/prefect/server/orchestration/core_policy.py:648:13-41: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:706:17-46: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:741:20-47: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:742:9-37: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:822:17-45: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:867:24-51: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:971:21-49: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:974:23-37: Argument `BaseModel | Unknown` is not assignable to parameter `state` with type `State | None` in function `prefect.server.orchestration.rules.BaseOrchestrationRule.reject_transition` [bad-argument-type]
- ERROR src/prefect/server/orchestration/core_policy.py:990:21-50: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:994:34-63: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:995:35-53: Object of class `BaseModel` has no attribute `id` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1023:21-49: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1024:30-58: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1125:21-43: Object of class `BaseModel` has no attribute `message` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1126:18-37: Object of class `BaseModel` has no attribute `data` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1172:20-48: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1178:25-47: Object of class `BaseModel` has no attribute `message` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1179:22-41: Object of class `BaseModel` has no attribute `data` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1202:16-45: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1209:12-32: Object of class `BaseModel` has no attribute `name` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1239:16-34: Object of class `BaseModel` has no attribute `name` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1269:16-44: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1270:13-41: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1271:17-44: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1302:26-53: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1338:16-44: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1339:13-41: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1340:17-44: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1361:29-48: Object of class `BaseModel` has no attribute `name` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1367:16-40: Object of class `BaseModel` has no attribute `is_running` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1374:20-48: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]
- ERROR src/prefect/server/orchestration/core_policy.py:1386:12-40: Object of class `BaseModel` has no attribute `state_details` [missing-attribute]

... (truncated 82 lines) ...

freqtrade (https://github.com/freqtrade/freqtrade)
- ERROR freqtrade/data/converter/converter.py:298:13-30: Cannot set item in `Series` [unsupported-operation]
- ERROR freqtrade/data/converter/converter.py:300:13-30: Cannot set item in `Series` [unsupported-operation]
- ERROR freqtrade/data/converter/orderflow.py:116:13-44: `Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` is not assignable to `datetime` [bad-assignment]
- ERROR freqtrade/data/converter/orderflow.py:118:16-30: Object of class `bool` has no attribute `any` [missing-attribute]
- ERROR freqtrade/data/converter/orderflow.py:124:25-76: Object of class `bool` has no attribute `any` [missing-attribute]
+ ERROR freqtrade/data/converter/orderflow.py:131:38-48: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:131:77-91: Cannot index into `_AtIndexerFrame` [bad-index]
+ ERROR freqtrade/data/converter/orderflow.py:134:30-45: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:142:30-48: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:150:30-49: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:153:30-61: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:157:30-61: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:169:30-48: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:170:30-48: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:172:30-42: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:173:30-42: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
+ ERROR freqtrade/data/converter/orderflow.py:174:30-44: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
- ERROR freqtrade/data/entryexitanalysis.py:58:57-87: Cannot index into `_LocIndexerFrame[DataFrame]` [bad-index]
+ ERROR freqtrade/data/converter/orderflow.py:175:34-46: Cannot index into `_AtIndexerFrame` [bad-index]
+ ERROR freqtrade/data/converter/orderflow.py:175:63-75: Cannot index into `_AtIndexerFrame` [bad-index]
+ ERROR freqtrade/data/converter/orderflow.py:177:30-51: Cannot set item in `_AtIndexerFrame` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:363:13-35: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:368:13-40: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:369:13-39: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:373:9-36: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:376:13-39: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:383:17-40: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:387:9-36: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:390:9-35: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:393:9-37: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/freqai/data_drawer.py:396:9-35: Cannot set item in `_iLocIndexerFrame[DataFrame]` [unsupported-operation]
- ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:307:84-88: Argument `Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64 | tuple[Hashable, ...]` is not assignable to parameter `first_column` with type `list[str] | str` in function `_generate_result_line` [bad-argument-type]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:433:21-46: Argument `Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:434:23-49: Argument `Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
- ERROR freqtrade/plot/plotting.py:187:17-97: Cannot index into `_LocIndexerFrame[DataFrame]` [bad-index]
- ERROR freqtrade/plot/plotting.py:188:17-96: Cannot index into `_LocIndexerFrame[DataFrame]` [bad-index]

pwndbg (https://github.com/pwndbg/pwndbg)
+ ERROR pwndbg/aglib/arch_mod.py:248:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/arch_mod.py:441:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/arch_mod.py:454:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/arch_mod.py:454:47-69: Object of class `object` has no attribute `name` [missing-attribute]
+ ERROR pwndbg/aglib/arch_mod.py:465:5-22: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/disasm/arm.py:277:38-49: Argument `int | None` is not assignable to parameter `cpsr_value` with type `int` in function `itstate_from_cpsr` [bad-argument-type]
+ ERROR pwndbg/aglib/argv.py:54:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/asm.py:30:31-48: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:53:46-63: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:55:46-63: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:225:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:227:29-46: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:232:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:235:40-57: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:239:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/commpage.py:241:40-57: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/disasm/assistant.py:214:75-95: Argument `int | None` is not assignable to parameter `number` with type `SupportsIndex` in function `hex` [bad-argument-type]
- ERROR pwndbg/aglib/disasm/disassembly.py:91:35-63: No matching overload found for function `dict.pop` called with arguments: (int | None, None) [no-matching-overload]
- ERROR pwndbg/aglib/disasm/disassembly.py:92:45-73: No matching overload found for function `dict.pop` called with arguments: (int | None, None) [no-matching-overload]
- ERROR pwndbg/aglib/disasm/disassembly.py:244:37-44: Argument `int | None` is not assignable to parameter `address` with type `int` in function `pwndbg.aglib.memory.peek` [bad-argument-type]
- ERROR pwndbg/aglib/disasm/disassembly.py:253:37-44: Argument `int | None` is not assignable to parameter `address` with type `int` in function `get_one_instruction` [bad-argument-type]
- ERROR pwndbg/aglib/disasm/disassembly.py:273:37-44: Argument `int | Unknown | None` is not assignable to parameter `address` with type `int` in function `pwndbg.aglib.memory.peek` [bad-argument-type]
- ERROR pwndbg/aglib/disasm/disassembly.py:276:32-39: Argument `int | Unknown | None` is not assignable to parameter `address` with type `int` in function `get_one_instruction` [bad-argument-type]
- ERROR pwndbg/aglib/disasm/x86.py:272:68-88: Argument `int | None` is not assignable to parameter `addr` with type `int` in function `pwndbg.aglib.memory.read_pointer_width` [bad-argument-type]
+ ERROR pwndbg/aglib/elf.py:84:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/elf.py:421:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/elf.py:527:53-70: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:64:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:67:7-24: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:90:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:93:7-24: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:249:43-60: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/godbg.py:261:21-38: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/heap/ptmalloc.py:1955:24-50: `-` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/heap/ptmalloc.py:1956:20-50: `-` is not supported between `None` and `int` [unsupported-operation]
+ ERROR pwndbg/aglib/ipi_helpers.py:19:8-25: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/ipi_helpers.py:20:6-23: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/ipi_helpers.py:21:6-23: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/kernel/__init__.py:282:20-29: `+` is not supported between `None` and `Literal[1]` [unsupported-operation]
- ERROR pwndbg/aglib/kernel/__init__.py:286:22-37: `+` is not supported between `None` and `int` [unsupported-operation]
+ ERROR pwndbg/aglib/kernel/__init__.py:278:12-29: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:279:13-30: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:281:12-29: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/kernel/__init__.py:443:20-53: Argument `int | None` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
- ERROR pwndbg/aglib/kernel/__init__.py:556:20-68: Argument `int | None` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR pwndbg/aglib/kernel/__init__.py:314:58-75: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:433:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:443:20-37: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:556:20-37: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:561:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:563:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:570:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:572:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:574:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:581:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:583:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/kernel/__init__.py:779:17-51: Argument `int | None` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR pwndbg/aglib/kernel/__init__.py:767:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:779:17-34: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/__init__.py:869:12-29: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/bpf.py:210:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/dmabuf.py:9:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/dmabuf.py:94:36-53: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/dmabuf.py:97:52-69: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kallsyms.py:215:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:38:22-39: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:59:22-39: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:78:31-48: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:84:36-53: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:103:22-39: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:104:33-50: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:117:37-54: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:131:22-39: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:141:72-89: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:144:68-85: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:149:28-45: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:188:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:192:68-85: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:193:64-81: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:197:69-86: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/kmod.py:205:53-70: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:31:19-36: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:42:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:68:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:90:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:110:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:146:19-36: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:160:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:162:11-28: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:169:14-31: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:254:26-43: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:257:31-48: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:281:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:363:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:368:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:422:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:473:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:478:23-40: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:510:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:652:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:725:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:762:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:777:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:780:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:825:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:866:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:929:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:982:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:1019:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/ktask.py:1030:27-44: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/mapletree.py:17:19-36: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:66:24-41: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:71:21-38: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:332:54-71: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:435:74-91: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:495:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:508:27-44: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:515:27-44: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:523:15-32: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:564:17-34: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:564:44-61: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:596:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:603:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:635:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:642:34-51: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:672:28-45: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:696:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:699:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:716:34-51: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:725:34-51: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:757:27-44: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:851:29-46: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:871:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:891:17-34: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:891:44-61: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:925:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:928:25-42: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:937:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:941:42-59: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/paging.py:942:21-38: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/slab.py:467:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/slab.py:495:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/slab.py:565:15-32: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/symbol.py:65:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/symbol.py:706:16-33: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/kernel/vmmap.py:201:20-61: Argument `int | None` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR pwndbg/aglib/kernel/vmmap.py:201:20-37: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:234:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:235:20-37: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:245:24-41: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:316:40-57: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:348:40-57: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:377:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:379:10-27: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:385:24-41: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:426:17-34: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:456:8-25: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/kernel/vmmap.py:467:43-60: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/memory.py:201:12-29: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/memory.py:201:48-65: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/memory.py:244:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/memory.py:350:23-40: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/memory.py:351:24-41: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/nearpc.py:452:14-16: Argument `int | None` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR pwndbg/aglib/nearpc.py:450:14-31: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/next.py:286:12-29: `<=` is not supported between `int` and `None` [unsupported-operation]
- ERROR pwndbg/aglib/next.py:286:12-29: `<` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/next.py:301:16-38: `<=` is not supported between `int` and `None` [unsupported-operation]
- ERROR pwndbg/aglib/next.py:301:16-38: `<` is not supported between `None` and `int` [unsupported-operation]
+ ERROR pwndbg/aglib/next.py:62:51-68: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:132:27-44: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:242:31-48: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:253:30-47: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:255:34-51: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:284:10-27: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:290:12-29: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/next.py:308:26-43: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/objc.py:491:11-28: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/objc.py:1075:22-29: Argument `int | None` is not assignable to parameter `addr` with type `int` in function `Object.__init__` [bad-argument-type]
- ERROR pwndbg/aglib/objc.py:1076:24-31: Argument `int | None` is not assignable to parameter `ptr` with type `int` in function `Selector.__init__` [bad-argument-type]
+ ERROR pwndbg/aglib/objc.py:1064:12-29: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/objc.py:1072:19-36: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/objc.py:1073:19-36: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:142:24-41: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
- ERROR pwndbg/aglib/onegadget.py:392:61-97: `+` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/onegadget.py:394:43-79: `+` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/onegadget.py:394:86-122: `+` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/onegadget.py:441:61-97: `+` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/onegadget.py:443:43-79: `+` is not supported between `None` and `int` [unsupported-operation]
- ERROR pwndbg/aglib/onegadget.py:443:86-122: `+` is not supported between `None` and `int` [unsupported-operation]
+ ERROR pwndbg/aglib/onegadget.py:392:72-89: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:394:54-71: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:394:97-114: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:441:72-89: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:443:54-71: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/onegadget.py:443:97-114: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/proc.py:157:16-33: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:76:38-55: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:84:34-51: No attribute `regs` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:88:28-45: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:158:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:161:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:165:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:170:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:174:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:178:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]
+ ERROR pwndbg/aglib/regs_mod.py:182:25-42: No attribute `arch` in module `pwndbg.aglib` [missing-attribute]

... (truncated 1008 lines) ...```

@rexledesma
Copy link
Copy Markdown
Contributor Author

The proposed rule would be very similar to this rule that already exists: https://pyrefly.org/en/docs/error-kinds/#implicit-import

@rexledesma rexledesma force-pushed the rl/no-exports-from-typechecking branch from 6edf11e to daa0ce3 Compare June 1, 2026 23:42
@github-actions github-actions Bot added size/l and removed size/l labels Jun 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Primer Diff Classification

❌ 34 regression(s) | ➖ 2 neutral | ❓ 1 needs review | 37 project(s) total | +1790, -428 errors

34 regression(s) across cloud-init, mkosi, steam.py, jax, spark, prefect, pwndbg, comtypes, starlette, mongo-python-driver, schemathesis, beartype, cibuildwheel, pytest-autoprofile, hydra-zen, zulip, pandas-stubs, hydpy, pandas, pytest-robotframework, meson, numpy-stl, core, trio, sphinx, xarray, spack, itsdangerous, pydantic, boostedblob, discord.py, optuna, kopf, django-modern-rest. error kinds: missing-module-attribute, missing-attribute, bad-argument-type. caused by calculate_exports(), pruned_if_branches_with_type_checking().

Project Verdict Changes Error Kinds Root Cause
cloud-init ❌ Regression +62, -4 bad-typed-dict-key, missing-module-attribute pruned_if_branches_with_type_checking()
mkosi ❌ Regression +7 missing-module-attribute pruned_if_branches_with_type_checking()
steam.py ❌ Regression +31 missing-attribute on utils.todo pruned_if_branches_with_type_checking()
jax ❌ Regression +241 missing-attribute, missing-module-attribute pruned_if_branches_with_type_checking()
spark ❌ Regression +23, -19 not-callable on GroupBy (new +19, removed -15) pyrefly/lib/export/definitions.rs
prefect ❌ Regression +19, -201 bad-argument-type, bad-assignment pruned_if_branches_with_type_checking()
freqtrade ➖ Neutral +17, -19 New unsupported-operation/bad-index on _AtIndexerFrame pyrefly/lib/export/definitions.rs
pwndbg ❌ Regression +455, -59 missing-attribute on module pwndbg.aglib pyrefly/lib/export/definitions.rs
comtypes ❌ Regression +11, -13 bad-argument-type on Optional passed to len() pruned_if_branches_with_type_checking()
starlette ❌ Regression +25 missing-module-attribute for TYPE_CHECKING dual-branch definitions pruned_if_branches_with_type_checking()
mongo-python-driver ❌ Regression +21, -5 missing-module-attribute (CodecOptions not importable) calculate_exports()
schemathesis ❌ Regression +1, -2 no-matching-overload message change pruned_if_branches_with_type_checking()
beartype ❌ Regression +31, -14 missing-module-attribute false positives from TYPE_CHECKING export filtering pyrefly/lib/export/definitions.rs
cibuildwheel ❌ Regression +3 TYPE_CHECKING-only exports not visible via attribute access in annotations pyrefly/lib/export/definitions.rs
pytest-autoprofile ❌ Regression +182, -21 invalid-annotation (148 new) pyrefly/lib/export/definitions.rs
pandera ➖ Neutral +3, -2 bad-argument-type, invalid-type-var pyrefly/lib/export/definitions.rs
hydra-zen ❌ Regression +2, -1 bad-assignment, missing-module-attribute pyrefly/lib/export/definitions.rs
aiohttp ❓ Needs Review +3 not-callable
zulip ❌ Regression +23 missing-module-attribute pruned_if_branches_with_type_checking()
pandas-stubs ❌ Regression +62 missing-module-attribute from TYPE_CHECKING in stubs pyrefly/lib/export/definitions.rs
hydpy ❌ Regression +1 bad-argument-type pruned_if_branches_with_type_checking()
pandas ❌ Regression +8, -17 missing-attribute on TYPE_CHECKING-only module attributes pyrefly/lib/export/definitions.rs
pytest-robotframework ❌ Regression +1 missing-module-attribute pruned_if_branches_with_type_checking()
meson ❌ Regression +267, -21 missing-attribute (TYPE_CHECKING exports hidden) pyrefly/lib/export/definitions.rs
numpy-stl ❌ Regression +3 missing-attribute pyrefly/lib/export/definitions.rs
core ❌ Regression +27 missing-attribute, missing-module-attribute pruned_if_branches_with_type_checking()
trio ❌ Regression +162, -2 missing-attribute on trio.socket module attributes pruned_if_branches_with_type_checking()
sphinx ❌ Regression +25 missing-module-attribute on TYPE_CHECKING-guarded sentinels pruned_if_branches_with_type_checking()
xarray ❌ Regression +4 bad-argument-count, bad-argument-type pruned_if_branches_with_type_checking()
spack ❌ Regression +1, -7 unsafe-overlap with Never pyrefly/lib/export/definitions.rs
itsdangerous ❌ Regression +2 bad-specialization, missing-module-attribute pruned_if_branches_with_type_checking()
pydantic ❌ Regression +6 missing-module-attribute for LazyClassAttribute/SafeGetItemProxy pyrefly/lib/export/definitions.rs
boostedblob ❌ Regression +5 false positive: TYPE_CHECKING else-branch export not recognized pruned_if_branches_with_type_checking()
discord.py ❌ Regression +29, -17 missing-attribute (cached_property) pyrefly/lib/export/definitions.rs
optuna ❌ Regression -4 missing-attribute, unsupported-operation pyrefly/lib/export/definitions.rs
kopf ❌ Regression +25 TYPE_CHECKING exports hidden from attribute access pyrefly/lib/export/definitions.rs
django-modern-rest ❌ Regression +2 missing-module-attribute pruned_if_branches_with_type_checking()
Detailed analysis

❌ Regression (34)

cloud-init (+62, -4)

The PR introduces a regression. The if TYPE_CHECKING: ... else: MetaSchema = dict pattern is a standard Python idiom where a name has both a type-checking definition (TypedDict) and a runtime definition (dict). Pyrefly's new logic incorrectly marks MetaSchema as type_checking_only because the type checker evaluates TYPE_CHECKING=True and prunes the else branch before the definitions builder can see the runtime assignment. This causes 62 false positive missing-module-attribute errors and loses 4 correct bad-typed-dict-key errors.
Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only flag) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) cause pyrefly to treat MetaSchema as non-exportable. The bug is that when TYPE_CHECKING evaluates to True during type checking, pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs skips the else branch entirely (via take_while_inclusive), so the else: MetaSchema = dict definition never clears the type_checking_only flag.

mkosi (+7)

The PR incorrectly marks names as type_checking_only when they are defined in BOTH branches of if TYPE_CHECKING: ... else: .... Since the type checker prunes the else branch (evaluating TYPE_CHECKING as True), the else branch definitions never merge, and the flag stays true. This causes valid runtime-available names (Popen, CompletedProcess) to be treated as non-exportable, producing 7 false positive missing-module-attribute errors.
Attribution: The change to pruned_if_branches_with_type_checking() in pyrefly_python/src/sys_info.rs and the type_checking_only tracking in pyrefly/lib/export/definitions.rs cause this regression. When TYPE_CHECKING evaluates to true, the else branch is pruned by filter(|x| x.0 != Some(false)), so the runtime definitions of Popen/CompletedProcess in the else branch never call merge() to clear the type_checking_only flag. The names are then incorrectly excluded from exports by the check in pyrefly/lib/export/exports.rs line 355-357.

steam.py (+31)

missing-attribute on utils.todo: The todo name in steam/utils.py is defined in both the if TYPE_CHECKING branch (as deprecated(...)) and the else branch (as a regular function). The PR's logic should merge these and clear type_checking_only, but it appears to incorrectly mark todo as type-checking-only, making it invisible when accessed as utils.todo. This is a false positive — 0/7 co-reported by mypy/pyright.
invalid-annotation NotRequired in TypedDict: These 24 errors claiming NotRequired may only be used for TypedDict members are likely cascade failures from the same export visibility bug. Types imported under TYPE_CHECKING in the target modules may be incorrectly hidden, causing type resolution failures. All 24 are pyrefly-only, confirming false positives.

Overall: The analysis is factually correct. Looking at steam/utils.py lines 693-701, todo is indeed defined in both branches of the if TYPE_CHECKING / else block: in the TYPE_CHECKING branch as deprecated("This method is not yet implemented") and in the else branch as a regular function decorator. The PR's type_checking_only feature is incorrectly marking todo as type-checking-only despite it being defined in both branches, making it invisible when accessed as utils.todo from steam/client.py. The analysis correctly identifies this as a false positive (0/7 co-reported by mypy/pyright). The characterization of the 24 NotRequired errors as likely cascade failures from the same type-checking-only visibility bug is a reasonable hypothesis, and the fact that 0/24 are co-reported by mypy or pyright supports the false positive conclusion.

Attribution: The changes in pyrefly/lib/export/definitions.rs (the type_checking_only flag and its propagation via pruned_if_branches_with_type_checking()) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) caused these errors. The missing-attribute errors on utils.todo suggest the else branch of if TYPE_CHECKING is not correctly clearing the type_checking_only flag when the name is also defined outside TYPE_CHECKING. The invalid-annotation errors on NotRequired are likely cascade failures from TYPE_CHECKING-guarded imports becoming invisible.

jax (+241)

This is a regression. The PR correctly identifies that names defined ONLY under TYPE_CHECKING should not be exported at runtime. However, the implementation has a bug: for if TYPE_CHECKING: ... else: ... patterns, pyrefly (as a type checker) evaluates the if branch and skips the else branch. This means names like safe_map that are defined in BOTH branches (with different implementations — a typed version under TYPE_CHECKING and a C extension version in else) are incorrectly marked as type_checking_only because pyrefly never processes the else branch's definition. In jax/_src/util.py, safe_map is defined at line 100 under if TYPE_CHECKING: AND at line 108 under else:. Both branches define the name, so it exists at runtime. The PR's merge() logic (self.type_checking_only &= in_type_checking) would correctly handle this IF the else branch were processed, but since pruned_if_branches_with_type_checking filters it out, the merge never happens. All 241 errors (181 missing-module-attribute + 60 missing-attribute) stem from this single root cause: safe_map, safe_zip, foreach, and potentially other names from jax._src.util are incorrectly hidden from exports.
Attribution: The change in pyrefly/lib/export/definitions.rs introduces the type_checking_only flag on Definition. In pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs, when TYPE_CHECKING evaluates to True, the else branch is filtered out (via take_while_inclusive). So the else branch definitions (e.g., safe_map = jaxlib_utils.safe_map) are never processed, and the name remains type_checking_only = true. Then in pyrefly/lib/export/exports.rs line 376, type_checking_only names are excluded from exports. This causes all 241 errors — downstream files can't import safe_map, safe_zip, etc. from jax._src.util.

spark (+23, -19)

not-callable on GroupBy (new +19, removed -15): These are the same false positive pattern — pandas GroupBy objects do have fillna/etc methods. The type parameter changed from SeriesGroupBy[Any, int] to SeriesGroupBy[Any], causing 15 old errors to be replaced by 19 new ones. Net: 4 more false positives. Regression.
bad-argument-type (new +2): Both pyrefly-only. The resample.py error is a stub inference issue (Index vs Timestamp). The test file error is similar. These are false positives introduced by changed type resolution. Regression.
no-matching-overload (new +2): Confirmed by pyright (2/2). DataFrame.sort_values called with by=Index[str] — pyright agrees this doesn't match overloads. These may be legitimate type issues. Improvement.
unsupported-operation removed (-2): DataFrame supports setitem for setting columns. These were false positives. Improvement.
bad-index removed (-2): _LocIndexerFrame supports indexing — .loc is a core pandas feature. These were false positives. Improvement.

Overall: This is a mixed bag. The 19 removals are all improvements (removing false positives). The 19 new not-callable errors are essentially the same false positives as before with slightly different type parameters — they replace 15 old ones, adding 4 net new false positives. The 2 new bad-argument-type errors are pyrefly-only false positives from stub inference. The 2 no-matching-overload errors are confirmed by pyright and may be legitimate. Overall: 19 false positives removed, ~21 false positives added (net +2 false positives), plus 2 potentially real errors. The net effect is roughly neutral to slightly worse.

Attribution: The changes to pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs that mark type_checking_only definitions and exclude them from exports changed how pandas stub types are resolved. This altered the generic parameter resolution for SeriesGroupBy (from [Any, int] to [Any]), causing the not-callable error message changes. The removed unsupported-operation and bad-index errors likely result from better type resolution through the in_type_checking tracking in pyrefly/lib/binding/stmt.rs and pyrefly/lib/alt/solve.rs.

prefect (+19, -201)

This is a clear improvement. The PR fixes how TYPE_CHECKING-guarded exports are handled, which dramatically improved type resolution in the prefect codebase. 201 false positives were removed (types previously resolving to BaseModel, object, or Unknown now resolve correctly). The 19 new errors are mostly confirmed by pyright (18/19 in pyright, 8/19 in mypy). However, the nature of these new errors is nuanced. The 8 unsupported-operation errors are confirmed by both mypy and pyright and appear to be genuine type issues now visible due to better resolution. The 10 new bad-return errors, while confirmed by pyright, have return types containing Unknown (e.g., list[Unknown] instead of list[WorkQueue]), suggesting the declared return type annotations are still not fully resolved. These may represent a mix of genuine type mismatches and residual incomplete type resolution. The 1 not-async error is not confirmed by pyright and may be a false positive. The net reduction of 182 errors with substantially better type accuracy is a significant improvement overall.
Attribution: The changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs add type_checking_only tracking to definitions. The pruned_if_branches_with_type_checking() method in crates/pyrefly_python/src/sys_info.rs identifies TYPE_CHECKING branches. The in_type_checking flag in pyrefly/lib/binding/bindings.rs and pyrefly/lib/binding/stmt.rs propagates this to import resolution. The key change in pyrefly/lib/alt/solve.rs allows resolving TYPE_CHECKING-only exports when the import is also under TYPE_CHECKING. This improved type resolution across the prefect codebase, removing false positives where types were resolving to BaseModel/object/Unknown and revealing real type issues that were previously hidden.

pwndbg (+455, -59)

missing-attribute on module pwndbg.aglib: 450 false positive errors claiming fundamental attributes like regs, arch, memory don't exist on pwndbg.aglib. These are runtime-assigned module attributes, likely type-annotated under TYPE_CHECKING. The PR's new export filtering incorrectly hides them. 0/214 confirmed by mypy/pyright.
bad-argument-type cascade: 4 new bad-argument-type errors are downstream cascades from the missing-attribute failures — when module attributes resolve to unknown, subsequent type checks produce spurious errors.
missing-attribute on object: 1 error accessing .name on pwndbg.aglib.arch which resolves to object due to the upstream resolution failure.
removed real errors: 59 previously-reported errors (bad-argument-type, unsupported-operation, etc.) disappeared because the module attributes now resolve to unknown types, suppressing all downstream checking. These were likely catching real type issues.

Overall: The PR correctly implements the concept that TYPE_CHECKING-only definitions shouldn't be importable at runtime. However, it breaks the common pattern where a module defines runtime attributes dynamically (e.g., pwndbg.aglib.set_arch()) and only provides type annotations under TYPE_CHECKING. The 450 new missing-attribute errors across 90 files in a well-tested project, with 0% confirmation from mypy/pyright, clearly indicate false positives. The 59 removed errors represent lost detection capability as a cascade effect.

Per-category reasoning:

  • missing-attribute on module pwndbg.aglib: 450 false positive errors claiming fundamental attributes like regs, arch, memory don't exist on pwndbg.aglib. These are runtime-assigned module attributes, likely type-annotated under TYPE_CHECKING. The PR's new export filtering incorrectly hides them. 0/214 confirmed by mypy/pyright.
  • bad-argument-type cascade: 4 new bad-argument-type errors are downstream cascades from the missing-attribute failures — when module attributes resolve to unknown, subsequent type checks produce spurious errors.
  • missing-attribute on object: 1 error accessing .name on pwndbg.aglib.arch which resolves to object due to the upstream resolution failure.
  • removed real errors: 59 previously-reported errors (bad-argument-type, unsupported-operation, etc.) disappeared because the module attributes now resolve to unknown types, suppressing all downstream checking. These were likely catching real type issues.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and filtering in exports.rs) and pyrefly/lib/alt/solve.rs (the in_type_checking guard check) cause names defined under if TYPE_CHECKING: to be hidden from normal imports. The pwndbg.aglib module likely defines attribute type annotations under TYPE_CHECKING while setting values at runtime, causing all 450 missing-attribute errors.

comtypes (+11, -13)

bad-argument-type on Optional passed to len(): 9 new errors where len(paramflags) is called but paramflags is Optional[tuple[...]]. All 9 confirmed by pyright. These are real type errors — None doesn't implement Sized. Improvement.
missing-attribute/_CData errors: 2 new errors (1 missing-attribute, 1 missing-module-attribute) for comtypes._CData. Both pyrefly-only. _CData is defined under TYPE_CHECKING in comtypes/init.py and accessed from other TYPE_CHECKING blocks. The PR correctly handles from X import Y under TYPE_CHECKING but doesn't handle attribute access (X.Y). These are false positives — regression.
removed bad-argument-type on _memberspec.py: 11 removed errors involving complex variadic tuple type matching for _DispIdlFlags. These were false positives from pyrefly being too strict with tuple type compatibility. Improvement.
removed missing-attribute on LP_SAFEARRAY.itemtype: 2 removed errors claiming _itemtype_ is not visible on LP_SAFEARRAY. The attribute is dynamically added via @Patch. Removing these false positives is correct. Improvement.

Overall: Net improvement: 13 false positives removed, 9 real bugs caught (confirmed by pyright — len() on Optional without None guard), and 2 new false positives introduced (pyrefly-only _CData resolution failures). The 2 regressions are minor compared to the 22 correct changes.

Per-category reasoning:

  • bad-argument-type on Optional passed to len(): 9 new errors where len(paramflags) is called but paramflags is Optional[tuple[...]]. All 9 confirmed by pyright. These are real type errors — None doesn't implement Sized. Improvement.
  • missing-attribute/_CData errors: 2 new errors (1 missing-attribute, 1 missing-module-attribute) for comtypes._CData. Both pyrefly-only. _CData is defined under TYPE_CHECKING in comtypes/init.py and accessed from other TYPE_CHECKING blocks. The PR correctly handles from X import Y under TYPE_CHECKING but doesn't handle attribute access (X.Y). These are false positives — regression.
  • removed bad-argument-type on _memberspec.py: 11 removed errors involving complex variadic tuple type matching for _DispIdlFlags. These were false positives from pyrefly being too strict with tuple type compatibility. Improvement.
  • removed missing-attribute on LP_SAFEARRAY.itemtype: 2 removed errors claiming _itemtype_ is not visible on LP_SAFEARRAY. The attribute is dynamically added via @Patch. Removing these false positives is correct. Improvement.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and tracking it through DefinitionsBuilder) and pyrefly/lib/export/exports.rs (filtering type_checking_only definitions from exports) caused the _CData errors — these names are now hidden from export but the attribute-access path (comtypes._CData) doesn't properly check is_type_checking_only_export. The pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs changed how definitions under TYPE_CHECKING are tracked, which altered type resolution for the removed errors. The new in_type_checking flag in pyrefly/lib/binding/stmt.rs enables imports inside TYPE_CHECKING to resolve TYPE_CHECKING-only exports, but attribute access isn't handled.

starlette (+25)

missing-module-attribute for TYPE_CHECKING dual-branch definitions: All 25 errors are Could not import TestClientFactory from tests.types. The class is defined in both the if TYPE_CHECKING: branch (as a Protocol) and the else branch (as a simple class). Since type checkers treat TYPE_CHECKING as True, only the if branch is analyzed. The PR's new logic marks TestClientFactory as type-checking-only because it is defined inside the if TYPE_CHECKING: block, and then prevents other modules from importing it. But this name should be importable — it's a legitimate export that exists in both branches and is always available. This is a common pattern (rich Protocol for type checking, simple stub for runtime). Neither mypy nor pyright flag this. This is a regression — 25 false positives introduced.

Overall: The PR introduces a new feature to prevent importing TYPE_CHECKING-only names outside of TYPE_CHECKING blocks. tests/types.py defines TestClientFactory in both branches of if TYPE_CHECKING: ... else: .... Since type checkers treat TYPE_CHECKING as True, only the if branch is analyzed and the else branch is dead code from the type checker's perspective. The PR's new logic marks TestClientFactory as type-checking-only because it is defined inside the if TYPE_CHECKING: block. This causes it to be excluded from the module's exports when other modules try to import it. However, this is a false positive because TestClientFactory is a legitimate export — it exists in both branches and is always available at runtime. The else branch provides a runtime stub, while the if TYPE_CHECKING branch provides the rich Protocol definition for type checking. This is a common and valid Python pattern. Neither mypy nor pyright flag this. All 25 missing-module-attribute errors are regressions introduced by the PR's overly aggressive type-checking-only detection.

Attribution: The PR adds a type_checking_only flag to Definition in pyrefly/lib/export/definitions.rs and uses pruned_if_branches_with_type_checking() in pyrefly/crates/pyrefly_python/src/sys_info.rs to track whether definitions are inside if TYPE_CHECKING: blocks. In pyrefly/lib/export/exports.rs, the exports() method (around line 355) skips type_checking_only definitions from the export set. The bug is that when a name is defined in BOTH the if TYPE_CHECKING: branch AND the else branch (as in tests/types.py), the else branch is pruned by the type checker (since TYPE_CHECKING evaluates to True), so the merge() in definitions.rs never clears the type_checking_only flag. The name is then incorrectly excluded from exports. Additionally, in pyrefly/lib/alt/solve.rs, the fallback resolution at line 4241 only allows type_checking_only exports when fallback.in_type_checking is true, but the test files import TestClientFactory outside of any TYPE_CHECKING guard, so the import fails.

mongo-python-driver (+21, -5)

missing-module-attribute (CodecOptions not importable): False positives. CodecOptions is defined in both if TYPE_CHECKING: and else: branches of bson/codec_options.py. The PR marks it type_checking_only because pyrefly only sees the TYPE_CHECKING branch (evaluating it as True) and prunes the else branch. This is a bug in the PR's logic.
bad-return cascade errors: Cascade from CodecOptions not being importable. Overload resolution for decode_all fails, producing incorrect return type errors.
missing-attribute on module/dict: Cascade from CodecOptions not being importable. The module attribute lookup fails, and downstream code that depends on CodecOptions types produces dict.raw errors.
invalid-type-var on _AsyncBulk/_Bulk: Likely cascade from changed type resolution affecting type variable scoping. Pyrefly-only, not flagged by mypy/pyright.
removed errors: The removed bad-argument-type and bad-return errors were likely false positives being fixed incidentally. The removed invalid-type-var errors on ClientEncryption classes may be side effects of the changed resolution.

Overall: The PR introduces a regression by incorrectly marking CodecOptions (and similar names) as type_checking_only when they have dual definitions — one under if TYPE_CHECKING: (a type stub) and one under else: (the runtime class). Since pyrefly treats TYPE_CHECKING as True, it prunes the else branch entirely, never seeing the runtime definition that should clear the type_checking_only flag. This causes 13 missing-module-attribute errors and 8 cascade errors, all pyrefly-only.

Per-category reasoning:

  • missing-module-attribute (CodecOptions not importable): False positives. CodecOptions is defined in both if TYPE_CHECKING: and else: branches of bson/codec_options.py. The PR marks it type_checking_only because pyrefly only sees the TYPE_CHECKING branch (evaluating it as True) and prunes the else branch. This is a bug in the PR's logic.
  • bad-return cascade errors: Cascade from CodecOptions not being importable. Overload resolution for decode_all fails, producing incorrect return type errors.
  • missing-attribute on module/dict: Cascade from CodecOptions not being importable. The module attribute lookup fails, and downstream code that depends on CodecOptions types produces dict.raw errors.
  • invalid-type-var on _AsyncBulk/_Bulk: Likely cascade from changed type resolution affecting type variable scoping. Pyrefly-only, not flagged by mypy/pyright.
  • removed errors: The removed bad-argument-type and bad-return errors were likely false positives being fixed incidentally. The removed invalid-type-var errors on ClientEncryption classes may be side effects of the changed resolution.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and tracking it through merge()) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports in calculate_exports()) cause the regression. When pyrefly evaluates TYPE_CHECKING as True, it only processes the if TYPE_CHECKING: branch, marks CodecOptions as type_checking_only, and the else branch (which defines the runtime CodecOptions) is pruned. The merge() method never gets called with in_type_checking=false to clear the flag.

schemathesis (+1, -2)

no-matching-overload message change: The error at _executor.py:279 is the same real issue (passing a generator to st.one_of), just with a less specific type in the message. The old error showed Generator[SearchStrategy[Case[Unknown]]], the new shows Generator[Unknown]. The error is still correctly flagged and confirmed by mypy/pyright. Slight regression in message quality but not in correctness.
bad-return false positive removed: The removed bad-return at stateful/init.py:478 was a false positive. The function transition returns rule(target=target, input=input)(step_function) which correctly returns a Rule, matching the declared return type. Removing this is an improvement.

Overall: Net change: The no-matching-overload error at _executor.py:279 persists with a less specific type in the message (Generator[Unknown] vs Generator[SearchStrategy[Case[Unknown]]]). This is a slight regression in message quality but the error is still correctly reported and confirmed by mypy/pyright.

The removed bad-return at stateful/init.py:478 was actually a true positive, not a false positive. The function transition has declared return type Callable[[Callable], Rule] (a decorator that takes a callable and returns a Rule), but it actually returns rule(target=target, input=input)(step_function) — which is the result of applying the decorator to step_function, yielding a Rule directly, not a Callable[[Callable], Rule]. The declared return type and actual return type genuinely don't match. Removing this error is a regression (false negative introduced).

Overall: one real error retained with slightly degraded message quality, and one true positive removed (regression).

Attribution: The changes to pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs and is_type_checking_only_export() in pyrefly/lib/export/exports.rs changed how TYPE_CHECKING-guarded definitions are resolved. This caused Case (imported under TYPE_CHECKING in _executor.py) to resolve differently, degrading the generator type from Generator[SearchStrategy[Case[Unknown]]] to Generator[Unknown]. It also improved resolution of StepOutput (imported under TYPE_CHECKING in stateful/init.py), removing the false positive bad-return.

beartype (+31, -14)

missing-module-attribute false positives from TYPE_CHECKING export filtering: 28 new errors claiming names like NoneType, NotImplementedType, HintPep695TypeAlias cannot be imported from beartype._cave._cavefast. These names are defined in both if TYPE_CHECKING: and else: branches, but the PR marks them as type_checking_only because the else branch is pruned during static analysis. All 28 are pyrefly-only (0/28 mypy, 0/28 pyright). This is a regression.
bad-argument-type cascade from import failures: 3 new bad-argument-type errors and 14 removed errors are downstream effects of the import failures above. When HintPep646692UnpackedType etc. fail to import, their types become Unknown, changing the union types in error messages. These are cascade effects, not independent changes.

Overall: The PR introduces a new concept of type_checking_only exports that should not be importable at runtime. However, it fails to handle the common pattern where a name is defined in BOTH if TYPE_CHECKING: AND else: branches. Since the type checker prunes the else branch (treating TYPE_CHECKING as True), the merge() call that would set type_checking_only = false never executes. This causes 28 false positive missing-module-attribute errors across beartype for names that are perfectly valid exports. The 14 removed errors are downstream cascade effects of these import failures, not genuine improvements.

Per-category reasoning:

  • missing-module-attribute false positives from TYPE_CHECKING export filtering: 28 new errors claiming names like NoneType, NotImplementedType, HintPep695TypeAlias cannot be imported from beartype._cave._cavefast. These names are defined in both if TYPE_CHECKING: and else: branches, but the PR marks them as type_checking_only because the else branch is pruned during static analysis. All 28 are pyrefly-only (0/28 mypy, 0/28 pyright). This is a regression.
  • bad-argument-type cascade from import failures: 3 new bad-argument-type errors and 14 removed errors are downstream effects of the import failures above. When HintPep646692UnpackedType etc. fail to import, their types become Unknown, changing the union types in error messages. These are cascade effects, not independent changes.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and setting it in DefinitionsBuilder) combined with pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) cause the regression. When the type checker evaluates if TYPE_CHECKING: as true and prunes the else branch, names defined only in the TYPE_CHECKING branch get type_checking_only = true and are never merged with the else branch definition (which would clear the flag). This makes names like NoneType, NotImplementedType unexportable.

cibuildwheel (+3)

TYPE_CHECKING-only exports not visible via attribute access in annotations: The PR marks EnvironmentExecutor as type_checking_only and excludes it from exports. But environment.py accesses it as bashlex_eval.EnvironmentExecutor in function signatures (type annotations). With from __future__ import annotations, these are never evaluated at runtime. The type checker should still resolve them. Neither mypy nor pyright flags this. This is a false positive introduced by the PR's overly strict export filtering.

Overall: This is a regression. The EnvironmentExecutor type alias is defined under if TYPE_CHECKING: in bashlex_eval.py (line 18). It is referenced as bashlex_eval.EnvironmentExecutor in type annotations in environment.py at lines 61, 102, and 120. These references are in function parameter type hints, and with from __future__ import annotations, they are never evaluated at runtime — they are purely for the type checker.

The PR's new logic correctly prevents runtime imports of TYPE_CHECKING-only names, but it incorrectly also blocks type-level attribute access to these names. When a type checker sees bashlex_eval.EnvironmentExecutor in a type annotation, it should resolve it because the type checker treats TYPE_CHECKING as True. The fact that the access site is not itself inside a TYPE_CHECKING block doesn't matter — the name is being used as a type annotation, not as a runtime value.

Mypy and pyright both handle this correctly: they make TYPE_CHECKING-only names visible for type-checking purposes regardless of where they're referenced. The PR's approach is too coarse — it should distinguish between runtime attribute access and type annotation usage, or at minimum allow attribute-style access to TYPE_CHECKING-only names from annotation contexts.

Per-category reasoning:

  • TYPE_CHECKING-only exports not visible via attribute access in annotations: The PR marks EnvironmentExecutor as type_checking_only and excludes it from exports. But environment.py accesses it as bashlex_eval.EnvironmentExecutor in function signatures (type annotations). With from __future__ import annotations, these are never evaluated at runtime. The type checker should still resolve them. Neither mypy nor pyright flags this. This is a false positive introduced by the PR's overly strict export filtering.

Attribution: The PR adds logic in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs to mark definitions inside if TYPE_CHECKING: blocks as type_checking_only = true, and then excludes them from the module's exports (line 355-357 in exports.rs). In pyrefly/lib/alt/solve.rs, the new code at line 4241-4243 only allows resolving type_checking_only exports when the import site itself is in_type_checking. Since cibuildwheel/environment.py accesses bashlex_eval.EnvironmentExecutor via attribute access (not import) and does so outside any TYPE_CHECKING guard (lines 61, 102, 120 are in regular function signatures), pyrefly now reports these as missing attributes. The PR correctly handles from b import x inside TYPE_CHECKING but fails to account for attribute-style access (module.Name) used in type annotations outside TYPE_CHECKING blocks.

pytest-autoprofile (+182, -21)

invalid-annotation (148 new): All pyrefly-only. These are cascade errors from the PR's new TYPE_CHECKING export filtering preventing resolution of type aliases and names. The project imports these names legitimately but pyrefly now blocks them.
unknown-name (31 new): All pyrefly-only. Names like always that were previously resolvable are now hidden by the TYPE_CHECKING export filter.
bad-override on AutoProfImporter (2 new): Likely cascade from type resolution failures caused by the export filtering.
unsupported-operation (1 new): Likely cascade from type resolution failures.
removed errors (21): Mixed bag — some were genuine false positives (property.set_name, NoneType.spec), others may have been real issues. But the removals are vastly outnumbered by the regressions.

Overall: The PR introduces a new feature to exclude TYPE_CHECKING-only definitions from module exports. While the concept is sound, the implementation causes 182 new errors (all pyrefly-only, 0 confirmed by mypy/pyright) against only 21 removed errors. The new errors are cascading failures from names that can no longer be resolved. This is a clear regression — the export filtering is too aggressive or has bugs in the fallback resolution path.

Per-category reasoning:

  • invalid-annotation (148 new): All pyrefly-only. These are cascade errors from the PR's new TYPE_CHECKING export filtering preventing resolution of type aliases and names. The project imports these names legitimately but pyrefly now blocks them.
  • unknown-name (31 new): All pyrefly-only. Names like always that were previously resolvable are now hidden by the TYPE_CHECKING export filter.
  • bad-override on AutoProfImporter (2 new): Likely cascade from type resolution failures caused by the export filtering.
  • unsupported-operation (1 new): Likely cascade from type resolution failures.
  • removed errors (21): Mixed bag — some were genuine false positives (property.set_name, NoneType.spec), others may have been real issues. But the removals are vastly outnumbered by the regressions.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and filtering in exports()) and pyrefly/lib/export/exports.rs (the is_type_checking_only check and filtering in the export calculation) cause names defined under TYPE_CHECKING to be excluded from exports. The logic in pyrefly/lib/alt/solve.rs that checks fallback.in_type_checking is supposed to allow resolution when the import is also under TYPE_CHECKING, but it appears to not work correctly for this project, causing 148+ cascading errors.

hydra-zen (+2, -1)

The PR's new TYPE_CHECKING export filtering is too aggressive. It correctly identifies that Field is defined under TYPE_CHECKING in the source module (hydra_zen.typing._implementations), but incorrectly blocks its import at the top level of consuming modules. This is a valid runtime import pattern — Field is dataclasses.Field, which exists at runtime. Neither mypy nor pyright flag this. The removed bad-assignment error is a cascade effect of Field becoming unresolvable: when Field can't be imported, the return type of _utils.field() becomes unknown/Any, which suppresses the type mismatch check at line 667-669. Note that the original bad-assignment error was actually a genuine type error — _utils.field() returns Field[Any] (a dataclass Field descriptor), which is not assignable to Union[BuildsFn[Any], Type[BuildsFn[Any]]]. The developers were aware of this, as evidenced by the # type: ignore comment on line 669. So the removed error was a true positive that was intentionally suppressed in the source code, and its disappearance is a regression caused by the unresolvable Field type.
Attribution: The changes in pyrefly/lib/export/definitions.rs (tracking type_checking_only flag) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) cause Field to no longer be importable from hydra_zen.typing._implementations when the import site is not inside a TYPE_CHECKING block. The pyrefly/lib/alt/solve.rs change that checks is_type_checking_only_export only allows resolution when fallback.in_type_checking is true.

zulip (+23)

The PR introduces a regression. zerver/lib/partial.py defines partial in both if TYPE_CHECKING: (with typed overloads) and else: (with functools.partial). The type checker correctly prunes the else branch, but the new type_checking_only logic then incorrectly concludes that partial is only available under TYPE_CHECKING and refuses to export it. Since the else branch is pruned before definitions are collected, the merge that would clear type_checking_only never happens. All 23 importing files get false missing-module-attribute errors. Neither mypy nor pyright flag any of these.
Attribution: The change to pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs and the type_checking_only flag in pyrefly/lib/export/definitions.rs cause this. When the type checker evaluates if TYPE_CHECKING:, it prunes the else branch (as expected for type checking). But the new type_checking_only flag is set to true because the only unpruned definition site is inside TYPE_CHECKING. The merge() method never gets called for the else branch (since it's pruned), so type_checking_only stays true, and the name is excluded from exports. This is incorrect for the if TYPE_CHECKING: ... else: ... pattern where the name exists in both branches.

pandas-stubs (+62)

missing-module-attribute from TYPE_CHECKING in stubs: The PR incorrectly filters out names defined under TYPE_CHECKING in .pyi stub files. Stub files are inherently type-checking-only, so TYPE_CHECKING guards should not affect their exports. All 21 errors are pyrefly-only false positives.
bad-specialization cascade errors: These 41 errors are downstream failures caused by the unresolved type aliases from the missing-module-attribute errors. When types like AnyArrayLikeInt can't be imported, type variable bounds and specializations break. All 41 are pyrefly-only.

Overall: This is a type stubs project (pandas-stubs). The PR's new logic to exclude TYPE_CHECKING-guarded names from exports is correct for .py files but incorrectly applies to .pyi stub files. In stub files, TYPE_CHECKING guards are semantically irrelevant — the entire file exists only for type checking. The PR should exempt .pyi files from this filtering. The 21 missing-module-attribute errors are direct false positives, and the 41 bad-specialization errors are cascading failures from unresolved types.

Per-category reasoning:

  • missing-module-attribute from TYPE_CHECKING in stubs: The PR incorrectly filters out names defined under TYPE_CHECKING in .pyi stub files. Stub files are inherently type-checking-only, so TYPE_CHECKING guards should not affect their exports. All 21 errors are pyrefly-only false positives.
  • bad-specialization cascade errors: These 41 errors are downstream failures caused by the unresolved type aliases from the missing-module-attribute errors. When types like AnyArrayLikeInt can't be imported, type variable bounds and specializations break. All 41 are pyrefly-only.

Attribution: The change in pyrefly/lib/export/definitions.rs that sets type_checking_only: true for definitions inside TYPE_CHECKING blocks, combined with the filtering in pyrefly/lib/export/exports.rs (the if definition.type_checking_only check in the export calculation), incorrectly applies to .pyi stub files. The PR does not distinguish between .py source files (where TYPE_CHECKING guards matter for runtime) and .pyi stub files (where everything is type-checking-only by definition). This causes names defined under TYPE_CHECKING in pandas-stubs' pandas/_typing.pyi to be excluded from exports, producing 21 missing-module-attribute errors and 41 cascade bad-specialization errors.

hydpy (+1)

This is a false positive. The variable date1 comes from enumerate(reversed(dataframe_resampled.index)), where dataframe_resampled is a pandas.DataFrame. Iterating over a pandas DatetimeIndex yields individual Timestamp objects (which are datetime subclasses), not Index objects. Pyrefly incorrectly infers the element type as Index — confusing the container type with the element type. The code is correct at runtime: pandas.Timestamp inherits from datetime, so passing it to timetools.Date() which accepts Date | datetime | str is valid. Neither mypy nor pyright flag this.
Attribution: The PR changes how TYPE_CHECKING-guarded definitions are exported. In hydpy/core/seriestools.py, pandas is imported under if TYPE_CHECKING: (line 13-14). The changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/binding/stmt.rs that track in_type_checking state and the new pruned_if_branches_with_type_checking() in pyrefly/lib/alt/answers_solver.rs likely changed how pandas types are resolved in this module. Previously pandas might have resolved as Unknown (suppressing downstream errors), but now it resolves through type stubs, exposing an inference bug where reversed() on a pandas Index yields Index instead of the element type.

pandas (+8, -17)

missing-attribute on TYPE_CHECKING-only module attributes: 6 new false positives: names like FormattersType and FloatFormatType are used as fmt.FormattersType in type annotations (with from future import annotations). These type aliases originate from pandas._typing and are imported directly under TYPE_CHECKING in frame.py. They are also likely available as attributes of pandas.io.formats.format (the fmt module) through that module's own TYPE_CHECKING imports. Since annotations are not evaluated at runtime due to from future import annotations, these module-qualified references only need to resolve during static analysis. Pyrefly incorrectly reports them as missing attributes on the fmt module.
cascade errors from changed type resolution: 2 new errors (no-matching-overload, not-iterable) appear to be downstream effects of the TYPE_CHECKING export changes affecting type inference, producing Unknown types where concrete types existed before.
removed false positives: 17 removed errors across bad-argument-type, unsupported-operation, missing-attribute, no-matching-overload, and bad-assignment categories. These were genuine false positives that are correctly no longer reported.

Overall: Net: 17 errors removed, 8 added. The removals are genuine false positive fixes (improvement). The 8 new errors are all pyrefly-only false positives. The 6 missing-attribute errors flag usage of fmt.FormattersType and fmt.FloatFormatType in type annotations. Looking at the source code, FormattersType and FloatFormatType are imported directly from pandas._typing under TYPE_CHECKING (lines 222-257), while fmt is imported as pandas.io.formats.format outside TYPE_CHECKING (line 187). The annotations use fmt.FormattersType and fmt.FloatFormatType as module-qualified names, but these type aliases are defined in pandas._typing, not in pandas.io.formats.format. However, pandas.io.formats.format likely re-imports or re-exports these names (possibly under its own TYPE_CHECKING block), making them available as module attributes for type-checking purposes. With from __future__ import annotations, these annotations are never evaluated at runtime, so the module-qualified references only need to resolve during static type checking. Pyrefly incorrectly reports these as missing attributes because it doesn't see these names as available on the fmt module, even though they should be visible in a type-checking context. The 2 remaining new errors (no-matching-overload, not-iterable) appear to be cascade effects from the changed type resolution producing Unknown types where concrete types existed before. Overall this is a mixed result leaning toward improvement due to the larger number of removed false positives, but the new errors are regressions.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only flag) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) cause names defined under TYPE_CHECKING to be hidden from module attribute access. The pyrefly/lib/alt/solve.rs change allows resolving these names when the import is itself inside TYPE_CHECKING, but doesn't handle the case where module-qualified attribute access (e.g., fmt.FormattersType) is used in type annotation context.

pytest-robotframework (+1)

This is a false positive. XmlElement is defined in both branches of if TYPE_CHECKING: ... else: ... in conftest.py. The else branch assigns XmlElement = _XmlElement (line 226), making it available at runtime. The PR's new logic correctly prunes the else branch for type-checking evaluation but incorrectly concludes the name is type-checking-only because the definitions builder never processes the else branch. The import at line 18 of test_python.py is outside any TYPE_CHECKING guard and is perfectly valid — XmlElement exists at runtime.
Attribution: The change to pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs prunes the else branch (since TYPE_CHECKING evaluates to true), so the else: XmlElement = _XmlElement definition is never seen by the definitions builder. Combined with the new type_checking_only flag in pyrefly/lib/export/definitions.rs and the filtering in pyrefly/lib/export/exports.rs, this causes XmlElement to be incorrectly marked as type-checking-only and filtered from exports, even though it has a runtime definition in the else branch.

meson (+267, -21)

missing-attribute (TYPE_CHECKING exports hidden): 252 false positive errors where TypedDicts and other types defined under if TYPE_CHECKING: in modules like jsonschema.py are no longer visible when accessed as module attributes (e.g., J.Type, J.Function). These are standard type-only definitions that should be visible during type checking. 0/252 co-reported by mypy or pyright.
missing-module-attribute (cascade from hidden exports): 6 false positive errors where names like Language from mesonbuild.compilers.compilers can't be imported, likely because they're defined under TYPE_CHECKING in the source module. 0/6 co-reported.
bad-index / no-matching-overload / bad-argument-type / unknown-name (cascade): 9 cascade errors caused by types resolving to Unknown instead of their concrete types, because the concrete type definitions are now hidden. These produce downstream type errors. 0/9 co-reported.
Removed errors (mixed): 21 removed errors are side effects of the same TYPE_CHECKING export changes. Some types that previously resolved concretely now resolve to Unknown, which changes the error landscape — some previous errors disappear (because Unknown is compatible with more things) while new ones appear. The net effect is worse: 267 new errors vs 21 removed.

Overall: This is a regression. The PR introduces a new restriction where definitions under if TYPE_CHECKING: are not exported from modules, making them invisible to importers outside TYPE_CHECKING blocks. While this has some theoretical correctness (these names don't exist at runtime), it breaks the extremely common Python typing pattern of defining TypedDicts, Protocols, and type aliases under TYPE_CHECKING and then using them in annotations throughout the codebase.

The meson project's docs/refman/jsonschema.py defines Type, Argument, Function, Object, Root, ObjectsByType TypedDicts under if T.TYPE_CHECKING:, and these are used as return type annotations like -> J.Type, -> J.Function in generatorjson.py and many other files. This is standard practice — mypy and pyright both handle this correctly by making TYPE_CHECKING-guarded definitions visible everywhere during type checking.

The 252 missing-attribute errors (e.g., "No attribute Type in module docs.refman.jsonschema") are all false positives — these attributes DO exist in the module for type checking purposes. The 6 missing-module-attribute errors, 3 bad-index errors, 2 no-matching-overload errors, 2 bad-argument-type errors, and 2 unknown-name errors are all downstream cascade effects of the same root cause: types resolving to Unknown because their definitions are now hidden.

Per the typing spec (https://typing.readthedocs.io/en/latest/spec/directives.html#type-checking), type checkers should evaluate TYPE_CHECKING as True, meaning all definitions under it should be visible. The PR's approach of hiding these from non-TYPE_CHECKING importers is too strict and not supported by the spec or by mypy/pyright behavior.

Per-category reasoning:

  • missing-attribute (TYPE_CHECKING exports hidden): 252 false positive errors where TypedDicts and other types defined under if TYPE_CHECKING: in modules like jsonschema.py are no longer visible when accessed as module attributes (e.g., J.Type, J.Function). These are standard type-only definitions that should be visible during type checking. 0/252 co-reported by mypy or pyright.
  • missing-module-attribute (cascade from hidden exports): 6 false positive errors where names like Language from mesonbuild.compilers.compilers can't be imported, likely because they're defined under TYPE_CHECKING in the source module. 0/6 co-reported.
  • bad-index / no-matching-overload / bad-argument-type / unknown-name (cascade): 9 cascade errors caused by types resolving to Unknown instead of their concrete types, because the concrete type definitions are now hidden. These produce downstream type errors. 0/9 co-reported.
  • Removed errors (mixed): 21 removed errors are side effects of the same TYPE_CHECKING export changes. Some types that previously resolved concretely now resolve to Unknown, which changes the error landscape — some previous errors disappear (because Unknown is compatible with more things) while new ones appear. The net effect is worse: 267 new errors vs 21 removed.

Attribution: The changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs are the root cause. Specifically:

  1. definitions.rs adds a type_checking_only: bool field to Definition and tracks whether definitions are inside TYPE_CHECKING blocks.
  2. exports.rs filters out type_checking_only definitions from the export list (in the exports() method around line 355-357), meaning they won't be visible to importers unless the importer is also inside TYPE_CHECKING.
  3. pyrefly/lib/alt/solve.rs adds a check at line 4241 that allows resolving TYPE_CHECKING-only exports when the import is itself inside TYPE_CHECKING.

The problem is that the meson project uses if T.TYPE_CHECKING: blocks to define TypedDicts and other type-only constructs in modules like jsonschema.py, and then references them as J.Type, J.Function, etc. in type annotations throughout the codebase. These annotation usages are NOT inside TYPE_CHECKING blocks — they're in regular function signatures. The PR's logic correctly identifies these definitions as type_checking_only but then incorrectly prevents them from being accessed via module attribute access (e.g., J.Type) in annotations outside TYPE_CHECKING blocks.

numpy-stl (+3)

The analysis is factually correct. The key facts are:

  1. Code structure is accurately described: Lines 814-825 of stl/stl.py show StlMesh defined in both branches of if TYPE_CHECKING: — as a function stub (lines 816-823) under TYPE_CHECKING, and as BaseStl.from_file in the else branch (lines 825-826). This is accurately stated.

  2. TYPE_CHECKING semantics are correct: A type checker should use the TYPE_CHECKING branch when analyzing code. The entire purpose of the if TYPE_CHECKING: / else: pattern is to provide a type-checker-visible definition that differs from the runtime definition. The type checker should see StlMesh as a module-level name in stl.stl.

  3. Module attribute access: The code in stl/main.py does from . import stl and then accesses stl.StlMesh. This is module attribute access, and the type checker should resolve StlMesh as a module-level name visible in stl.stl — which it is, under the TYPE_CHECKING branch.

  4. The diagnosis is correct: Pyrefly appears to be incorrectly excluding StlMesh from the module's exported names because it's defined under if TYPE_CHECKING:. But since a type checker operates in the TYPE_CHECKING=True world, it should see this definition. The else branch also defines the name, so StlMesh exists in both branches — it's always a valid module-level name.

  5. False positive conclusion is correct: These errors are false positives because StlMesh is a legitimate module-level attribute that should be visible to the type checker. The @type_check_only decorator is not applied to StlMesh itself (it's applied to _StatefulWriter on line 39-41). The StlMesh function stub is a regular definition under TYPE_CHECKING.

Attribution: The PR changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs introduce a type_checking_only flag on Definition. In exports.rs lines 355-358, definitions marked type_checking_only are excluded from the export map (unless they appear in __all__). This means StlMesh, defined at line 816 of stl/stl.py under if TYPE_CHECKING:, is now marked as type_checking_only=true and excluded from the module's exports. When stl/main.py does from . import stl and then accesses stl.StlMesh, pyrefly can't find StlMesh in the exports of stl.stl, producing the missing-attribute error. The fix in pyrefly/lib/alt/solve.rs (lines 4241-4243) only handles the case where the import site is under TYPE_CHECKING (via fallback.in_type_checking), but stl/main.py accesses stl.StlMesh via attribute access (stl.StlMesh), not via from stl.stl import StlMesh. Attribute access on an imported module doesn't go through the import fallback path, so the in_type_checking escape hatch doesn't apply.

core (+27)

The PR introduces a bug in handling the if TYPE_CHECKING: ... else: ... pattern. In homeassistant/helpers/json.py, json_bytes is defined in both branches: under if TYPE_CHECKING: as a typed function stub, and under else: as the runtime implementation via partial(orjson.dumps, ...). Since type checkers evaluate with TYPE_CHECKING = True, pyrefly only sees the if TYPE_CHECKING: branch. The new type_checking_only flag is then set on this definition, causing the type checker to treat json_bytes as not being a real export of the module. When other files like homeassistant/components/backup/manager.py try to import json_bytes from homeassistant.helpers.json, the type checker reports missing-module-attribute because the name is marked as type-checking-only and excluded from exports. This is a well-known Python pattern where a stub is provided for type checkers while the runtime uses a different implementation (here functools.partial). Both mypy (0/26 cross-check matches) and mostly pyright (1/26 cross-check match) handle this correctly by recognizing that a name defined in both branches of if TYPE_CHECKING should be considered exported. All 27 errors (26 missing-module-attribute and 1 missing-attribute) are false positives caused by this bug in the PR's handling of the type_checking_only flag.
Attribution: The change to pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs and the type_checking_only flag logic in pyrefly/lib/export/definitions.rs cause this. When TYPE_CHECKING evaluates to true (as it does for type checkers), the else branch containing the runtime definition of json_bytes is pruned. The merge() function's self.type_checking_only &= in_type_checking logic never fires because the else branch definition is never seen. The export filtering in pyrefly/lib/export/exports.rs (line ~355) then excludes json_bytes from exports, causing all 27 import errors.

trio (+162, -2)

missing-attribute on trio.socket module attributes: 156 errors claiming attributes like AF_INET, SOCK_DGRAM, IPPROTO_TCP, SocketType don't exist on trio.socket. These are standard socket constants re-exported by trio.socket and work at runtime. 0/76 confirmed by mypy or pyright. The PR's new TYPE_CHECKING export filtering incorrectly marks these as type-checking-only. Clear false positives (regression).
unknown-name errors: 5 errors for names like SocketType that can't be found. These are downstream effects of the same root cause — trio.socket exports being incorrectly hidden. 0/3 confirmed by mypy or pyright. Regression.
bad-argument-type on spawn_system_task: 1 error about Self@DTLSEndpoint vs DTLSEndpoint in unpacked tuple argument. Confirmed by pyright (1/1). This may be a legitimate type issue with Self type in a non-method context, but it's separate from the main regression pattern.
removed missing-attribute on SocketType.share: The removed error about SocketType.share was a false positive — share is a real Windows-only method and the test is properly guarded. Improvement.
removed no-matching-overload on run_process: The removed overload error for run_process called with stdin='oh no, it's text' — the test intentionally passes invalid input. The removal is likely correct as the overloads probably accept str. Improvement.

Overall: The PR introduces logic to prevent names defined only under if TYPE_CHECKING: from being exported. While the concept is sound (such names don't exist at runtime), the implementation is too aggressive for the trio project. The trio.socket module re-exports many standard socket constants (AF_INET, SOCK_DGRAM, IPPROTO_TCP, etc.) and types (SocketType). These are fundamental, well-known attributes that work at runtime. The fact that 0/76 of these errors are confirmed by mypy or pyright strongly indicates these are false positives — pyrefly is incorrectly determining that these names are type_checking_only when they are actually available at runtime. The 156 new missing-attribute errors and 5 unknown-name errors are all regressions. The 2 removed errors appear to be genuine improvements (removing false positives). The net effect is overwhelmingly negative: 162 new false positives vs 2 removed false positives.

Attribution: The PR changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs add a type_checking_only flag to Definition. In exports.rs line 355-357, definitions marked type_checking_only are excluded from the export set (unless they appear in __all__). This means that if trio.socket defines or re-exports names like AF_INET inside an if TYPE_CHECKING: block, those names are now hidden from importers. The trio.socket module likely has a pattern where it conditionally imports/defines socket constants, and the PR's new logic incorrectly marks them as type_checking_only. The pruned_if_branches_with_type_checking() method in sys_info.rs identifies TYPE_CHECKING branches, and the DefinitionsBuilder in definitions.rs propagates in_type_checking into definitions created within those branches. If trio.socket re-exports standard socket names inside a TYPE_CHECKING guard (common for type stubs that also work at runtime), those names get incorrectly flagged.

sphinx (+25)

missing-module-attribute on TYPE_CHECKING-guarded sentinels: The 21 missing-module-attribute errors all stem from pyrefly's new logic marking definitions inside if TYPE_CHECKING: as non-exportable. In _sentinels.py, the module uses TYPE_CHECKING = False as a deliberate pattern to provide different definitions for type checkers vs runtime. The type checker sees only the if TYPE_CHECKING: branch (evaluating it as True), marks those definitions as type_checking_only, and excludes them from exports. But these names (ALL, EMPTY, SUPPRESS, INSTANCE_ATTR, etc.) are legitimately importable — at runtime from the else branch, and during type checking from the if branch. This is a false positive regression.
bad-argument-type and not-iterable cascade errors: The 3 bad-argument-type and 1 not-iterable errors in _member_finder.py are cascading from the root cause above. When ALL cannot be imported from _sentinels, its type resolves incorrectly (as _AllTC from the TYPE_CHECKING block), causing downstream type incompatibilities like Sequence[str] | _AllTC not being assignable to Iterable[str] and _AllTC not being iterable. These are false positives caused by the same root issue.

Overall: The analysis is factually correct. The key facts are:

  1. _sentinels.py uses TYPE_CHECKING = False (line 3) as a local variable, not importing from typing. This is a deliberate pattern.

  2. A type checker evaluates TYPE_CHECKING as True, so it sees the if TYPE_CHECKING: branch (lines 59-97) which defines ALL, EMPTY, SUPPRESS, INSTANCE_ATTR, RUNTIME_INSTANCE_ATTRIBUTE, SLOTS_ATTR, UNINITIALIZED_ATTR and their type aliases.

  3. The else branch (lines 99-106) provides the runtime definitions of the same names.

  4. The PR's new logic marks definitions inside if TYPE_CHECKING: blocks as type_checking_only and excludes them from module exports. Since the type checker only sees the if branch definitions, and those are marked as type_checking_only, the names become non-exportable.

  5. This causes 21 missing-module-attribute errors across 10 files that import these names (e.g., from sphinx.ext.autodoc._sentinels import ALL, EMPTY, SUPPRESS).

  6. The 3 bad-argument-type and 1 not-iterable errors are correctly identified as cascading errors. When ALL resolves to _AllTC type from the TYPE_CHECKING block, Sequence[str] | _AllTC is indeed not assignable to Iterable[str] (since _AllTC is an enum that doesn't implement __iter__), and _AllTC is not iterable.

  7. The cross-check data (0/25 in mypy, 0/25 in pyright) correctly confirms these are false positives specific to pyrefly's new behavior.

The analysis correctly identifies the root cause and the cascading nature of the errors.

Attribution: The PR adds logic in pyrefly/lib/export/definitions.rs to track type_checking_only on definitions, and in pyrefly/lib/export/exports.rs to exclude type_checking_only definitions from exports. The pruned_if_branches_with_type_checking() method in crates/pyrefly_python/src/sys_info.rs identifies TYPE_CHECKING branches. The critical bug is in _sentinels.py: the module uses TYPE_CHECKING = False (a local reassignment on line 3), then if TYPE_CHECKING: on line 4. Pyrefly's is_type_checking_test function in pyrefly/lib/binding/stmt.rs checks if the test expression is a name TYPE_CHECKING — it matches the local variable TYPE_CHECKING even though it's been reassigned to False. The pruned_if_branches_with_type_checking in sys_info.rs similarly checks the name. So pyrefly marks the if TYPE_CHECKING: branch (lines 59-97) as type_checking_only=true AND the else branch (lines 99-106) also gets processed. But the else branch defines ALL, EMPTY, SUPPRESS etc. — these should NOT be type_checking_only. The issue is that pruned_if_branches_with_type_checking marks the TYPE_CHECKING branch as in_type_checking=true, but the else branch should have in_type_checking=false. Looking more carefully at the code: pruned_if_branches iterates over Ast::if_branches(x) which yields (test, body) pairs. For an if/else, it yields (Some(test), if_body) and (None, else_body). The is_type_checking_test check is test.is_some_and(Self::is_type_checking_test) — so for the else branch where test is None, in_type_checking would be false. So the else branch definitions should NOT be marked as type_checking_only. But wait — the definitions in the if TYPE_CHECKING: branch (lines 59-97) include ALL, EMPTY, SUPPRESS etc. (lines 69, 76, 91-97). These ARE marked as type_checking_only=true. Then in the else branch (lines 99-106), the same names are defined again. The merge() function does self.type_checking_only &= in_type_checking — so if the first definition was type_checking_only=true and the second is in_type_checking=false, the result is false. So the names should NOT end up as type_checking_only. But actually, sys_info.evaluate_bool evaluates TYPE_CHECKING — since TYPE_CHECKING = False on line 3, evaluate_bool returns Some(false) for the if TYPE_CHECKING: test. The pruned_if_branches filters out branches where branch_chosen == Some(false). So the if TYPE_CHECKING: branch is FILTERED OUT entirely, and only the else branch is processed. This means the else branch definitions are the ONLY definitions, and they have in_type_checking=false. So the names should NOT be type_checking_only. Hmm, but then why are the errors occurring? Let me re-read. The pruned_if_branches_with_type_checking method is used in definitions.rs (line 875). But pruned_if_branches (the old one) is used elsewhere. Wait — sys_info.evaluate_bool on TYPE_CHECKING (the local variable set to False) would return... The evaluate function checks for Expr::Name and looks up TYPE_CHECKING. The is_type_checking_constant_name returns true for TYPE_CHECKING, but evaluate handles it differently — it checks self.type_checking which is the SysInfo's type_checking field (which is true for type checkers). So evaluate_bool returns Some(true) for TYPE_CHECKING, regardless of the local assignment TYPE_CHECKING = False. This means the if TYPE_CHECKING: branch IS included (with in_type_checking=true), and the else branch is EXCLUDED (filtered out because branch_chosen == Some(false) after the take_while_inclusive). So the definitions from the if TYPE_CHECKING: branch (ALL, EMPTY, SUPPRESS, etc.) are marked as type_checking_only=true, and the else branch definitions are never seen. This causes the names to be type_checking_only=true, which means they're excluded from exports, causing the missing-module-attribute errors. This is a bug in pyrefly's new logic. The _sentinels.py module intentionally uses TYPE_CHECKING = False as a hack to provide different definitions for type checkers vs runtime. The type checker correctly sees the if TYPE_CHECKING: branch, but the new PR incorrectly marks those definitions as non-exportable. The names ARE meant to be importable by other modules (both at runtime from the else branch and during type checking from the if branch).

xarray (+4)

The DTypeLikeSave error is a false positive: the name has a runtime definition in the else branch of if TYPE_CHECKING: (line 98 of types.py), so it should be importable at runtime. The PR's new logic incorrectly marks it as type-checking-only. The missing.py errors (2-4) are independent false positives unrelated to DTypeLikeSave. They are caused by pyrefly incorrectly inferring type(index[0]) — when index is a pd.DatetimeIndex, index[0] returns a pd.Timestamp, and when index is a CFTimeIndex, index[0] returns a cftime datetime object. In both cases, type(index[0])(1970, 1, 1) constructs a datetime-like object. However, pyrefly appears to infer type(index[0]) as the index class itself (DatetimeIndex or CFTimeIndex) rather than the element type, leading it to check the arguments against DatetimeIndex.__new__ and CFTimeIndex.__new__ signatures instead of Timestamp() and cftime datetime constructors. All errors are pyrefly-only, confirming regression.
Attribution: Error 1 (DTypeLikeSave): The PR's pyrefly/lib/export/definitions.rs marks definitions inside if TYPE_CHECKING: with type_checking_only = true, and pyrefly/lib/export/exports.rs excludes such names from exports. The merge() function uses self.type_checking_only &= in_type_checking, which should correctly handle the else branch (setting it to false). However, the else branch of if TYPE_CHECKING: is evaluated with in_type_checking = false only if pruned_if_branches_with_type_checking() correctly identifies it — the bug may be that the else branch still inherits the flag. Errors 2-4: These appear unrelated to the PR's TYPE_CHECKING changes and may be a pre-existing inference issue exposed by the DTypeLikeSave import failure (cascade from error 1, since DTypeLikeSave becomes unresolvable).

spack (+1, -7)

unsafe-overlap with Never: New error at isinstance(vlist, Iterable) claims unsafe overlap with Never. The Never type indicates pyrefly narrowed the variable's type incorrectly after prior isinstance checks. In the VersionList.init method, vlist has type Optional[Union[str, VersionType, Iterable]]. After checking for str, None, VersionList, and (ConcreteVersion, ClosedOpenRange), non-VersionType Iterables (like list, tuple) should still remain in the union, so narrowing to Never is incorrect. Pyrefly-only, not flagged by mypy or pyright. This is an inference failure regression.
bad-specialization removals: 5 removed errors claiming str is not assignable to SupportsRichComparison upper bound. str supports all rich comparison methods (lt, gt, le, ge, eq, ne), so these were false positives. Removing them is an improvement.
bad-return removal: Removed error claiming tuple[Unknown, Any] is not assignable to SupportsRichComparison. The Unknown suggests an inference failure in the old version. Tuples do support rich comparison. Removing this false positive is an improvement.
bad-argument-type removal: Removed error about ConcreteVersion not assignable to StandardVersion. ConcreteVersion is the supertype of StandardVersion (StandardVersion extends ConcreteVersion, line 221), so passing a ConcreteVersion where StandardVersion is expected is a legitimate static type error. The reader() function (line 140) declares parameter type vn.StandardVersion, and self.db_version has declared return type vn.ConcreteVersion (line 638). While the runtime value is always a StandardVersion (set via StandardVersion.from_string on line 850), the declared types make this a valid error. Its removal is a minor regression, though the practical impact is low since the runtime types are correct.

Overall: Net effect: 1 new error (pyrefly-only, contains Never — inference failure) vs 7 removed errors (mostly false positives from incorrect TYPE_CHECKING export handling). The dominant pattern is removal of false positives caused by pyrefly previously failing to resolve types exported under TYPE_CHECKING guards. The single new error is a Never-type inference failure, which is a regression pattern per the guidelines, but it's outweighed by the 6 clearly removed false positives and 1 borderline removal.

Attribution: The changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs added type_checking_only tracking for definitions inside if TYPE_CHECKING: blocks. This changed how exports from modules like spack.util.typing (which likely exports SupportsRichComparison under TYPE_CHECKING) are resolved, fixing the false positive bad-specialization and bad-return errors. The new unsafe-overlap error with Never is a downstream effect of changed type resolution.

itsdangerous (+2)

The analysis is factually correct. The _TSerialized TypeVar is defined at module level in itsdangerous/serializer.py as a regular TypeVar, not under a TYPE_CHECKING guard. Pyrefly's new logic to suppress exports defined under TYPE_CHECKING guards appears to incorrectly classify _TSerialized as type_checking_only, causing the missing-module-attribute error when timed.py imports it. The bad-specialization error on TimedSerializer[str] in url_safe.py is indeed a cascade effect — since _TSerialized couldn't be resolved from the import, TimedSerializer (defined as class TimedSerializer(Serializer[_TSerialized])) would not appear to be generic, so TimedSerializer[str] would trigger a "Expected 0 type arguments" error. Both errors are correctly identified as pyrefly-only false positives.
Attribution: The changes in pyrefly/lib/export/definitions.rs (the type_checking_only field and its propagation through DefinitionsBuilder) and pyrefly/lib/export/exports.rs (the filtering in exports() that skips type_checking_only definitions) are incorrectly marking _TSerialized in itsdangerous/serializer.py as type-checking-only, preventing its export. The pruned_if_branches_with_type_checking() method in pyrefly/lib/alt/solve.rs combined with the export filtering logic in exports.rs lines 355-357 causes the false positive. The second error is a cascade from the first.

pydantic (+6)

missing-module-attribute for LazyClassAttribute/SafeGetItemProxy: LazyClassAttribute uses the standard if TYPE_CHECKING: ... else: ... pattern. The else branch provides the runtime class, the if branch provides the typing stub. The PR incorrectly marks it as type_checking_only because the else branch is pruned during type checking. SafeGetItemProxy is a regular dataclass defined outside TYPE_CHECKING at line 378 of _utils.py (it only has a if TYPE_CHECKING: block inside the class for the __contains__ method). Both should be validly exportable. These are false positives.
missing-attribute for _repr.ReprArgs: ReprArgs is a TypeAlias defined under TYPE_CHECKING in _repr.py. It's used in type annotations across the codebase (e.g., the return type of __repr_args__ in ValueItems). The PR now blocks it from being exported, but type aliases under TYPE_CHECKING should be available to type checkers — that's the entire purpose of TYPE_CHECKING blocks for type aliases. This is a false positive.

Overall: The PR introduces a new mechanism to prevent exporting names defined only under TYPE_CHECKING, but it has bugs causing false positives: (1) For if TYPE_CHECKING: def X ... else: class X ... patterns, the else branch is pruned by the type checker, so the name is only seen in the TYPE_CHECKING branch and incorrectly marked as unexportable. This affects LazyClassAttribute. (2) Type aliases like ReprArgs defined under TYPE_CHECKING should be available to type checkers in other modules, but the PR blocks them unless the import is also inside TYPE_CHECKING. (3) SafeGetItemProxy is a regular dataclass defined outside TYPE_CHECKING (line 378 of _utils.py), but it contains a if TYPE_CHECKING: block inside the class for __contains__. The import error for SafeGetItemProxy may be caused by the same overly aggressive mechanism. These are all false positives — the code is correct and both mypy and pyright handle it fine.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and tracking it through pruned_if_branches_with_type_checking) and pyrefly/lib/export/exports.rs (filtering out type_checking_only names from exports) cause these errors. The problem is that the if TYPE_CHECKING: ... else: ... pattern (where the else branch provides the runtime definition) is not handled correctly — the else branch is pruned by the type checker, so the name is only seen in the TYPE_CHECKING branch and incorrectly marked as type_checking_only. Additionally, TYPE_CHECKING-only type aliases like ReprArgs should still be importable by other modules' type-checking code, but the PR only allows this when the import is itself inside a TYPE_CHECKING guard (via in_type_checking in ImportFallback), which doesn't cover all cases (e.g., top-level annotation usage).

boostedblob (+5)

false positive: TYPE_CHECKING else-branch export not recognized: The PR marks etree as type_checking_only because the type checker prunes the else branch of if TYPE_CHECKING: in boostedblob/xml.py. But etree is defined in both branches — it's a legitimate export available at runtime (from lxml) and at type-check time (from xml.etree.ElementTree). The merge() logic in definitions.rs never sees the else branch definition because it was already pruned, so type_checking_only stays true. This causes all 5 downstream missing-module-attribute errors in files that import etree from boostedblob.xml.

Overall: The analysis is factually correct. In boostedblob/xml.py, etree is defined in both branches of if TYPE_CHECKING: — in the if branch (lines 3-6) it's assigned as an alias for xml.etree.ElementTree, and in the else branch (lines 7-8) it's imported from lxml. A type checker evaluates TYPE_CHECKING as True, so it only sees the if branch and never processes the else branch. The PR's new logic apparently marks etree as type_checking_only because it only sees the definition from the if TYPE_CHECKING: branch, not recognizing that the else branch provides a runtime definition. Since etree is legitimately exported and used by other modules (_recover.py, azure_auth.py, listing.py, request.py, write.py), all 5 missing-module-attribute errors are false positives caused by the same root issue — the type checker incorrectly treating etree as type-checking-only when it has a valid runtime definition in the else branch.

Attribution: The change in pyrefly/lib/export/definitions.rs introduces a type_checking_only flag on Definition. In the merge() method (line ~125), it does self.type_checking_only &= in_type_checking, meaning a definition is only NOT type_checking_only if ALL definition sites are outside TYPE_CHECKING. However, in boostedblob/xml.py, the if TYPE_CHECKING: branch defines etree = _etree and the else branch defines from lxml import etree. The merge() logic should correctly handle this (the else branch is NOT in_type_checking, so type_checking_only should become false). But the issue is in pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs — the else branch of an if TYPE_CHECKING: block gets pruned (filtered out by filter(|x| x.0 != Some(false))), so the definition in the else branch is never seen by the definitions builder. Since TYPE_CHECKING evaluates to True for the type checker, the else branch is pruned, and only the if TYPE_CHECKING: branch's definition of etree is recorded — with type_checking_only = true. Then in pyrefly/lib/export/exports.rs line ~355, the type_checking_only names are excluded from exports, causing the missing-module-attribute errors in all importing files. The bug is that the PR doesn't account for the pattern where a name is defined in BOTH the TYPE_CHECKING branch and the else branch — the else branch definition is pruned by the type checker (correctly, since TYPE_CHECKING is True), but the name should still be considered exported because it exists at runtime via the else branch.

discord.py (+29, -17)

missing-attribute (cached_property): 14 errors claiming cached_property is missing from discord.utils. This is a well-known runtime utility in discord.py that exists at runtime. The PR's TYPE_CHECKING export filtering is incorrectly hiding it. All 14 are pyrefly-only - regression.
missing-module-attribute (ClientT and others): 7 errors about failing to import names like ClientT from discord._types. Looking at the source, ClientT is defined in BOTH the if TYPE_CHECKING: branch (with default=Client) and the else: branch (without default). Since it exists in both branches, it should not be marked as type_checking_only. The PR's logic fails to recognize the else branch definition or incorrectly marks it anyway. All 7 are pyrefly-only - regression.
bad-specialization: 2 errors claiming BaseChannelTransformer takes 0 type args. This is a cascade from failing to import ClientT - if ClientT isn't resolved, Transformer(Generic[ClientT]) loses its type parameter, making BaseChannelTransformer appear to take 0 type arguments. When RawChannelTransformer(BaseChannelTransformer[ClientT]) and UnionChannelTransformer(BaseChannelTransformer[ClientT]) try to specialize it, they fail. Regression.
unsupported-operation: 2 errors about types not being subscriptable. Cascade from the ClientT/TYPE_CHECKING resolution failure. Regression.
no-matching-overload (new): 2 new errors co-reported by mypy (2/2 also in mypy). These appear to be legitimate type errors or pre-existing issues that may be unrelated to the TYPE_CHECKING changes, though imprecise type resolution from the PR could contribute.
bad-assignment and bad-return (new): Cascade errors from the TYPE_CHECKING resolution failures. The types become imprecise when ClientT can't be resolved properly. Regression.
removed no-matching-overload on CachedSlotProperty: 12 removed false positives. CachedSlotProperty.get overloads were previously not matching correctly. The improved TYPE_CHECKING handling fixed the type resolution. Improvement.
removed bad-override and bad-return: 5 removed errors that were false positives. The improved handling corrected type resolution in some cases. Improvement.

Overall: The PR introduces a mechanism to mark definitions as type_checking_only and exclude them from exports. The core issue is that the PR incorrectly handles the ClientT TypeVar from discord._types. Looking at the source code, ClientT is defined in BOTH branches:

  • if TYPE_CHECKING: branch: ClientT = TypeVar('ClientT', bound=Client, covariant=True, default=Client) using typing_extensions.TypeVar
  • else: branch: ClientT = TypeVar('ClientT', bound='Client', covariant=True) using standard typing.TypeVar

Since ClientT exists in both branches, it should NOT be marked as type_checking_only. However, the two definitions differ: the TYPE_CHECKING version includes default=Client, while the else version does not. If the PR's logic incorrectly marks ClientT as type_checking_only (failing to recognize the else branch), or if it uses the else branch's definition which lacks the default parameter, this would cause cascading failures throughout the codebase.

The 14 cached_property missing-attribute errors indicate that discord.utils.cached_property is being incorrectly hidden. This is a well-known runtime utility in discord.py. The PR's TYPE_CHECKING export filtering is incorrectly suppressing it. All 14 are pyrefly-only regressions.

The 7 missing-module-attribute errors about ClientT stem from the PR failing to properly export ClientT from discord._types. Since ClientT is defined in both branches, it should be available. All 7 are pyrefly-only regressions.

The 2 bad-specialization errors ("Expected 0 type arguments for BaseChannelTransformer, got 1") are cascading from the ClientT resolution failure. If ClientT can't be imported, then Transformer(Generic[ClientT]) loses its type parameter, making BaseChannelTransformer appear to take 0 type arguments. When RawChannelTransformer(BaseChannelTransformer[ClientT]) and UnionChannelTransformer(BaseChannelTransformer[ClientT]) try to specialize it, they fail. These are regressions.

The 2 unsupported-operation errors about types not being subscriptable are also cascading from the ClientT/TYPE_CHECKING resolution failure. Regressions.

The 2 no-matching-overload errors on Webhook.send are co-reported by mypy (2/2), suggesting these may be legitimate type errors or pre-existing issues unrelated to the PR's TYPE_CHECKING changes.

The bad-assignment and bad-return errors are cascade effects from imprecise type resolution when ClientT can't be properly resolved.

The 12 removed no-matching-overload errors on CachedSlotProperty.__get__ are genuine improvements - the PR's changes fixed type resolution for these overloads.

The 5 removed bad-override and bad-return errors are also genuine improvements from corrected type resolution.

Overall: 27 new errors are predominantly false positives from overly aggressive TYPE_CHECKING filtering (regressions), while 17 removed errors are genuine improvements. Net negative impact.

Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only flag) and pyrefly/lib/export/exports.rs (filtering exports based on type_checking_only) cause names that are defined under TYPE_CHECKING to be excluded from exports. The bug is likely in how pruned_if_branches_with_type_checking or Definition::merge handles cases where a name like cached_property is defined/imported under TYPE_CHECKING but also exists at runtime (e.g., via the else branch or unconditional definition). The is_type_checking_only_export check in pyrefly/lib/alt/solve.rs gates resolution on fallback.in_type_checking, but the export filtering in exports.rs line 355-358 incorrectly excludes names from the export map even when they have runtime definitions.

optuna (-4)

The removed errors involve attributes resolving to None or NoneType. For the FrozenTrial.values cases (lines 57), values in optuna's FrozenTrial is typed as Optional[Sequence[float]], meaning it can be None. The type checker correctly identifies that subscripting an Optional type without a None guard could fail, since None is not subscriptable. Similarly, the total_seconds error likely involves a return type that includes None in a union. The PR likely improved how pyrefly handles type resolution or narrowing in these contexts - possibly by better resolving types from modules that use TYPE_CHECKING guards, or by improving how optional types from third-party stubs are handled. The net effect is that these attributes are now properly resolved to their full types rather than collapsing to None, eliminating the false positive errors.
Attribution: The changes in pyrefly/lib/export/definitions.rs (adding type_checking_only field and tracking in_type_checking state), pyrefly/lib/export/exports.rs (adding is_type_checking_only and is_type_checking_only_export methods), and pyrefly/lib/alt/solve.rs (the new check if fallback.in_type_checking && self.exports.is_type_checking_only_export(m, name)) together enable TYPE_CHECKING-guarded imports to resolve names that are only defined under TYPE_CHECKING in the target module. This fixes the resolution of optuna types like FrozenTrial, eliminating the downstream false positives.

kopf (+25)

TYPE_CHECKING exports hidden from attribute access: All 25 errors stem from aiotasks.Future and aiotasks.Task being defined under if TYPE_CHECKING: in kopf/_cogs/aiokits/aiotasks.py. The PR's new logic marks these as type_checking_only and excludes them from exports. When other modules access them via aiotasks.Future (module attribute access, not import statements), pyrefly can't find them. This is incorrect — type checkers should see all names defined under TYPE_CHECKING during type checking. The PR handles from module import name inside TYPE_CHECKING blocks correctly, but module attribute access (module.name) doesn't go through the ImportFallback.in_type_checking path, so it always fails. 0/25 co-reported by mypy or pyright.

Overall: The analysis is factually correct. The key facts are:

  1. Future and Task are defined in both branches of if TYPE_CHECKING: In aiotasks.py lines 22-27, Future and Task are defined under if TYPE_CHECKING: (as asyncio.Future[Any] and asyncio.Task[Any]) and also in the else branch (as asyncio.Future and asyncio.Task). A type checker should use the TYPE_CHECKING branch definitions, making these names fully available during type checking.

  2. The names are accessed via module attribute access: Other modules do from kopf._cogs.aiokits import aiotasks and then reference aiotasks.Future and aiotasks.Task as type annotations. This is standard Python practice.

  3. Type checkers should see TYPE_CHECKING-guarded names: Both mypy and pyright treat names defined under if TYPE_CHECKING: as available during static analysis. The fact that 0/25 errors are co-reported by mypy or pyright confirms these are false positives.

  4. The analysis correctly identifies the mechanism: The PR's new logic marks Future and Task as type_checking_only and excludes them from the module's exports. When other modules access them via aiotasks.Future (module attribute access), pyrefly can't find them because the attribute lookup on the module doesn't go through the same ImportFallback.in_type_checking path that handles from module import name statements.

  5. All 25 errors are missing-attribute errors: They all follow the pattern "No attribute Future in module kopf._cogs.aiokits.aiotasks" or similar for Task, which is consistent with the described mechanism.

The analysis is logically consistent and factually accurate throughout.

Attribution: The PR adds a new type_checking_only flag in pyrefly/lib/export/definitions.rs (lines adding type_checking_only: bool to Definition). In pyrefly/lib/export/exports.rs, the exports() method now skips definitions where type_checking_only is true (unless they're in __all__). In pyrefly/lib/alt/solve.rs, a new check fallback.in_type_checking && self.exports.is_type_checking_only_export(m, name) allows resolving these names only when the import is itself under TYPE_CHECKING. The pyrefly/lib/binding/stmt.rs changes track whether we're inside a TYPE_CHECKING block via self.in_type_checking. The net effect: names defined under if TYPE_CHECKING: in module A are no longer visible to importers in module B unless the import in B is also under if TYPE_CHECKING:. In kopf's case, aiotasks.py defines Future and Task under if TYPE_CHECKING:, and other modules access them as aiotasks.Future (attribute access on the module, not from aiotasks import Future). The attribute access path aiotasks.Future is NOT an import statement, so the in_type_checking flag on ImportFallback doesn't apply — the module-level attribute lookup fails because Future is now hidden from exports.

django-modern-rest (+2)

Both errors are false positives. The PR correctly identifies TYPE_CHECKING-only definitions but fails to handle the common pattern where a name is defined in BOTH branches of if TYPE_CHECKING: ... else: .... Since the type checker prunes the else branch, it never sees the runtime definition, and incorrectly marks the name as type_checking_only. Both identity and Json are available at runtime and should be importable.
Attribution: The changes in pyrefly/lib/export/definitions.rs (the type_checking_only flag and its propagation via merge()) combined with pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs cause names defined in the TYPE_CHECKING branch to be marked as non-exportable. The bug is that when the type checker prunes the else branch (since TYPE_CHECKING=True), the else-branch definition is never processed, so the type_checking_only &= in_type_checking merge never clears the flag. The export filtering in exports.rs line 376 (&& !def.type_checking_only) then excludes these names.

➖ Neutral (2)

freqtrade (+17, -19)

New unsupported-operation/bad-index on _AtIndexerFrame: These 15 errors flag standard pandas DataFrame.at[] accessor operations as unsupported. The .at accessor is a well-documented pandas API for scalar access. Neither mypy nor pyright flags these. These are false positives introduced by the changed type resolution of pandas-stubs exports under TYPE_CHECKING.
New bad-argument-type on int conversion: These 2 errors flag int() calls with pandas scalar types. The union type includes types like float, int, etc. that are valid for int(). These appear to be false positives from overly broad type inference.
Removed unsupported-operation on Series: 12 removed false positives. Operations like df_dtypes[column] = np.float32 are valid pandas Series item assignment.
Removed bad-index on _LocIndexerFrame: 3 removed false positives. .loc indexing on DataFrames is valid pandas.
Removed missing-attribute 'any' on bool: 2 removed false positives. The expression returns a pandas Series, not bool. Pyrefly was incorrectly inferring the type as bool.
Removed bad-assignment and bad-argument-type: 2 removed false positives from incorrect pandas type inference.

Overall: This is roughly neutral — 19 false positives removed, 17 new false positives added. The new errors are all pyrefly-only and flag valid pandas .at accessor operations. The removed errors were also false positives on pandas operations. The net effect is a slight improvement (2 fewer false positives), but the new errors are still problematic. Since the removed errors span more files and the new errors are concentrated in one file, and the overall count slightly favors improvement, this leans toward neutral-to-slight-improvement.

Per-category reasoning:

  • New unsupported-operation/bad-index on _AtIndexerFrame: These 15 errors flag standard pandas DataFrame.at[] accessor operations as unsupported. The .at accessor is a well-documented pandas API for scalar access. Neither mypy nor pyright flags these. These are false positives introduced by the changed type resolution of pandas-stubs exports under TYPE_CHECKING.
  • New bad-argument-type on int conversion: These 2 errors flag int() calls with pandas scalar types. The union type includes types like float, int, etc. that are valid for int(). These appear to be false positives from overly broad type inference.
  • Removed unsupported-operation on Series: 12 removed false positives. Operations like df_dtypes[column] = np.float32 are valid pandas Series item assignment.
  • Removed bad-index on _LocIndexerFrame: 3 removed false positives. .loc indexing on DataFrames is valid pandas.
  • Removed missing-attribute 'any' on bool: 2 removed false positives. The expression returns a pandas Series, not bool. Pyrefly was incorrectly inferring the type as bool.
  • Removed bad-assignment and bad-argument-type: 2 removed false positives from incorrect pandas type inference.

Attribution: The PR changes in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs add type_checking_only tracking to definitions and filter them from exports. The pruned_if_branches_with_type_checking in sys_info.rs identifies TYPE_CHECKING branches. These changes altered how pandas-stubs types are resolved — some types that were previously exported from pandas-stubs under TYPE_CHECKING guards are now handled differently, shifting which pandas accessor types pyrefly sees. This caused the old false positives on Series/_LocIndexerFrame to disappear and new false positives on _AtIndexerFrame to appear.

pandera (+3, -2)

This is essentially neutral. Two errors were swapped for equivalent errors with different inferred types. For model.py, the return type of pd.array([]) changed from NumpyExtensionArray to ArrowStringArray — both are ExtensionArray subclasses, and the underlying issue (dict item assignment with that type) is the same. For hypotheses.py, the generic parameter count of DataFrameGroupBy and SeriesGroupBy changed from two type parameters ([Unknown, Unknown]) to one ([Unknown]), reflecting a change in how pyrefly resolves the generic signatures of these pandas GroupBy types. The underlying error (passing list[tuple[Unknown, Unknown]] where a GroupBy type is expected) remains the same. The new fastapi.py error about Unknown where T should be is noted — pyright also flags this line, suggesting it's a pre-existing issue with resolving the T TypeVar imported from pandera.typing.common, not necessarily a regression from this PR's changes. Net: 3 added, 2 removed = +1 net error, and the substance of the swapped errors is unchanged.
Attribution: The PR adds TYPE_CHECKING-aware export filtering in pyrefly/lib/export/definitions.rs and pyrefly/lib/export/exports.rs. The fastapi.py error likely stems from T being defined under TYPE_CHECKING in pandera.typing.common, and the new logic in exports.rs (line 353-355) filtering it out of exports. The other changes (ArrowStringArray vs NumpyExtensionArray, single vs double type params) appear to be side effects of changed type resolution paths when TYPE_CHECKING handling changed.

❓ Needs Review (1)

aiohttp (+3)

LLM requested additional files that could not be resolved. Non-trivial change (3 added, 0 removed).

Suggested fixes

Summary: The PR's type_checking_only export filtering has two critical bugs: (1) names defined in both if-TYPE_CHECKING and else branches are incorrectly marked type_checking_only because the else branch is pruned before definitions merge, and (2) TYPE_CHECKING-only names are invisible via module attribute access (module.Name) even in type annotation contexts, causing ~1500+ false positive errors across 30+ projects.

1. In pruned_if_branches_with_type_checking() in crates/pyrefly_python/src/sys_info.rs, the method filters out the else branch (via .filter(|x| x.0 != Some(false))) when TYPE_CHECKING evaluates to true. This means the else branch's definitions are never processed, so Definition::merge() is never called with in_type_checking=false, and the type_checking_only flag is never cleared. The fix: when a branch is pruned AND the if-test is a TYPE_CHECKING test, still yield the else branch's body but with a new flag indicating 'pruned but defines runtime names'. Concretely, change the method to NOT filter out the else branch of an if-TYPE_CHECKING block — instead, yield it with in_type_checking=false so that DefinitionsBuilder processes those definitions and merge() correctly clears type_checking_only. The key change is: remove the .filter(|x| x.0 != Some(false)) line, or modify it to preserve else branches when the corresponding if-test was a TYPE_CHECKING test. The else branch body should still be yielded with (false, body) so definitions are collected with in_type_checking=false.

Files: crates/pyrefly_python/src/sys_info.rs, pyrefly/lib/export/definitions.rs
Confidence: high
Affected projects: cloud-init, mkosi, jax, starlette, mongo-python-driver, zulip, beartype, core, discord.py, kopf, boostedblob, numpy-stl, pydantic, django-modern-rest, pytest-robotframework, itsdangerous, steam.py, sphinx, xarray
Fixes: missing-module-attribute, missing-attribute, bad-specialization, bad-return, bad-argument-type, unknown-name, invalid-annotation, unsupported-operation
This is the root cause of the vast majority of regressions. When TYPE_CHECKING=True (as type checkers evaluate it), the else branch is pruned by .filter(|x| x.0 != Some(false)). Names like safe_map (jax), partial (zulip), etree (boostedblob), MetaSchema (cloud-init), Popen (mkosi), TestClientFactory (starlette), CodecOptions (mongo), json_bytes (core), Future/Task (kopf), ClientT (discord.py), StlMesh (numpy-stl), NoneType (beartype), todo (steam.py), cached_property (discord.py), etc. are all defined in BOTH branches but only the TYPE_CHECKING branch definition is seen. The merge() call with in_type_checking=false never happens, so type_checking_only stays true. Fixing this eliminates ~1200+ missing-module-attribute and missing-attribute errors across cloud-init (62), mkosi (7), jax (241), starlette (25), mongo (21), zulip (23), beartype (31), core (27), discord.py (29), kopf (25), boostedblob (5), numpy-stl (3), pydantic (6), django-modern-rest (2), pytest-robotframework (1), itsdangerous (2), and more.

2. In the export filtering logic in pyrefly/lib/export/exports.rs (around line 355-357 and the is_type_checking_only_export method), and in pyrefly/lib/alt/solve.rs (line 4241-4243), TYPE_CHECKING-only names are only resolvable when the import site has in_type_checking=true. But this only works for from module import name statements inside TYPE_CHECKING blocks. It does NOT work for module attribute access like module.Name used in type annotations (e.g., J.Type, fmt.FormattersType, aiotasks.Future, bashlex_eval.EnvironmentExecutor). The fix: in the attribute resolution path (likely in solve.rs where module attribute access is resolved), add the same fallback check that allows resolving type_checking_only exports. Specifically, when resolving module.attr and attr is not found in regular exports, check is_type_checking_only_export(module, attr) and if true, resolve it — because a type checker should always see TYPE_CHECKING-guarded names. The guard should be unconditional for attribute access in annotation contexts (or simply unconditional, since the type checker always operates with TYPE_CHECKING=True).

Files: pyrefly/lib/alt/solve.rs, pyrefly/lib/export/exports.rs
Confidence: high
Affected projects: meson, pandas, cibuildwheel, kopf, trio, pwndbg, pytest-autoprofile, comtypes
Fixes: missing-attribute, missing-module-attribute, unknown-name, invalid-annotation, bad-argument-type, bad-index, no-matching-overload
Even after fixing the if/else pruning bug (suggestion 1), there will still be names that are ONLY defined under TYPE_CHECKING (no else branch) — like TypedDicts, Protocols, type aliases. These are legitimately type-checking-only but should still be visible to the type checker everywhere, not just inside TYPE_CHECKING blocks. The typing spec says type checkers evaluate TYPE_CHECKING as True, meaning all such definitions should be visible during type checking. The current code only allows resolution when fallback.in_type_checking is true, but module attribute access (module.Name) doesn't go through ImportFallback. This causes regressions in meson (267 errors from J.Type, J.Function etc.), pandas (6 errors from fmt.FormattersType), cibuildwheel (3 errors from bashlex_eval.EnvironmentExecutor), kopf (25 errors from aiotasks.Future), trio (162 errors from trio.socket attributes), pwndbg (455 errors), and pytest-autoprofile (182 errors).

3. In pyrefly/lib/export/definitions.rs, the type_checking_only flag should NOT be applied to .pyi stub files. Stub files are inherently type-checking-only — their entire purpose is to provide type information. TYPE_CHECKING guards in .pyi files are used for conditional imports/definitions but should not affect export visibility. Add a guard in DefinitionsBuilder (or in the pruned_if_branches_with_type_checking call site in definitions.rs around line 875) that skips setting type_checking_only=true when the module is a .pyi file. Pseudo-code: let in_type_checking = if self.module_info.[is_stub()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/export/definitions.rs) { false } else { branch_in_type_checking };

Files: pyrefly/lib/export/definitions.rs
Confidence: high
Affected projects: pandas-stubs
Fixes: missing-module-attribute, bad-specialization
pandas-stubs is a .pyi stub project where TYPE_CHECKING guards are used inside stub files. The PR incorrectly applies type_checking_only filtering to these stubs, causing 21 missing-module-attribute errors and 41 cascade bad-specialization errors (62 total, all pyrefly-only). Stub files should be exempt from this filtering since they exist solely for type checking.

4. In pyrefly/lib/alt/solve.rs line 4241, the condition fallback.in_type_checking && self.exports.is_type_checking_only_export(m, name) should simply be self.exports.is_type_checking_only_export(m, name) — i.e., remove the fallback.in_type_checking guard. A type checker always operates with TYPE_CHECKING=True, so TYPE_CHECKING-only exports should always be resolvable during type checking, regardless of whether the import site is itself inside a TYPE_CHECKING block. The in_type_checking guard is only needed for runtime behavior, which a type checker doesn't enforce.

Files: pyrefly/lib/alt/solve.rs
Confidence: medium
Affected projects: hydra-zen, itsdangerous, pytest-autoprofile, pwndbg
Fixes: missing-module-attribute, bad-specialization, invalid-annotation, unknown-name
This is a simpler alternative to suggestion 2 for the from module import name path. Currently, from module import Name outside a TYPE_CHECKING block fails to resolve TYPE_CHECKING-only names because fallback.in_type_checking is false. But type checkers should see all TYPE_CHECKING-guarded names everywhere. Removing the in_type_checking guard would fix cases like hydra-zen (Field import), itsdangerous (_TSerialized import), and others where names are imported at module level outside TYPE_CHECKING. However, this alone won't fix module attribute access (module.Name) — suggestion 2 is still needed for that.


Was this helpful? React with 👍 or 👎

Classification by primer-classifier (37 LLM)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Definitions under TYPE_CHECKING should not be importable

2 participants