Skip to content

Conversation

@jackulau
Copy link
Contributor

Summary

Fixes #2055 - False negatives in uninitialized local detection when branches end with function calls.

The Bug: When a branch ended with a function call like foo(), pyrefly incorrectly assumed the branch might terminate with NoReturn, suppressing uninitialized variable warnings even for regular functions.

def foo() -> None: pass

if condition():
    x = 5
else:
    foo()  # Bug: this suppressed the warning

print(x)  # x may be uninitialized - but no error was reported!

The Fix: Move initialization checking to solve time where we have type information to determine if a function actually returns Never.

Approach

The root cause is that "branch termination is actually a type-level concern, but uninitialized local checks happen at binding time."

This PR defers the initialization check to solve time by:

  1. Tracking termination keys - When merging flows, track the last expression statement for branches that don't initialize a variable
  2. New Binding::InitCheck - Instead of emitting errors at binding time, create an InitCheck binding that defers the check
  3. Solve-time verification - At solve time, check if ALL termination keys resolve to Never type. Only suppress the error if all non-initializing branches truly return NoReturn

Test Cases Added

  • test_if_defines_variable_in_one_side_with_call
  • test_if_defines_variable_with_noreturn_branch
  • test_nested_if_with_inner_regular_call
  • test_multiple_branches_all_noreturn

Test Plan

  • All 90 flow_branching tests pass
  • All existing NoReturn-related tests pass

@meta-cla meta-cla bot added the cla signed label Jan 12, 2026
@github-actions

This comment has been minimized.

body branches and the body ends with a function call.
@github-actions
Copy link

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

psycopg (https://github.com/psycopg/psycopg)
+ ERROR psycopg/psycopg/_cursor_base.py:238:48-51: `pgq` may be uninitialized [unbound-name]
+ ERROR psycopg/psycopg/_cursor_base.py:270:48-51: `pgq` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool.py:260:16-20: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool.py:262:24-27: `pos` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool.py:268:75-77: `t0` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool.py:273:9-13: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool.py:274:16-20: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool_async.py:297:16-20: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool_async.py:299:30-33: `pos` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool_async.py:305:75-77: `t0` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool_async.py:310:9-13: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/pool_async.py:311:16-20: `conn` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/sched.py:96:34-39: `delay` may be uninitialized [unbound-name]
+ ERROR psycopg_pool/psycopg_pool/sched_async.py:99:48-53: `delay` may be uninitialized [unbound-name]
+ ERROR tests/fix_db.py:96:22-25: `dsn` may be uninitialized [unbound-name]
+ ERROR tests/fix_db.py:97:12-15: `dsn` may be uninitialized [unbound-name]
+ ERROR tests/fix_db.py:192:22-26: `conn` may be uninitialized [unbound-name]
+ ERROR tests/fix_db.py:193:15-19: `conn` may be uninitialized [unbound-name]
+ ERROR tests/fix_db.py:195:5-9: `conn` may be uninitialized [unbound-name]
+ ERROR tests/scripts/pipeline-demo.py:105:16-17: `r` may be uninitialized [unbound-name]
+ ERROR tests/scripts/spiketest.py:33:9-12: `opt` may be uninitialized [unbound-name]
+ ERROR tests/scripts/spiketest.py:34:18-21: `opt` may be uninitialized [unbound-name]
+ ERROR tests/scripts/spiketest.py:35:18-21: `opt` may be uninitialized [unbound-name]
+ ERROR tests/scripts/spiketest.py:46:28-31: `opt` may be uninitialized [unbound-name]
+ ERROR tests/test_transaction.py:613:16-19: `tx3` may be uninitialized [unbound-name]
+ ERROR tests/test_transaction.py:613:30-33: `tx3` may be uninitialized [unbound-name]
+ ERROR tests/test_transaction_async.py:620:16-19: `tx3` may be uninitialized [unbound-name]
+ ERROR tests/test_transaction_async.py:620:30-33: `tx3` may be uninitialized [unbound-name]
+ ERROR tools/update_error_prefixes.py:96:12-15: `opt` may be uninitialized [unbound-name]
+ ::error file=psycopg/psycopg/_cursor_base.py,line=238,col=48,endLine=238,endColumn=51,title=Pyrefly unbound-name::`pgq` may be uninitialized
+ ::error file=psycopg/psycopg/_cursor_base.py,line=270,col=48,endLine=270,endColumn=51,title=Pyrefly unbound-name::`pgq` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool.py,line=260,col=16,endLine=260,endColumn=20,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool.py,line=262,col=24,endLine=262,endColumn=27,title=Pyrefly unbound-name::`pos` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool.py,line=268,col=75,endLine=268,endColumn=77,title=Pyrefly unbound-name::`t0` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool.py,line=273,col=9,endLine=273,endColumn=13,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool.py,line=274,col=16,endLine=274,endColumn=20,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool_async.py,line=297,col=16,endLine=297,endColumn=20,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool_async.py,line=299,col=30,endLine=299,endColumn=33,title=Pyrefly unbound-name::`pos` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool_async.py,line=305,col=75,endLine=305,endColumn=77,title=Pyrefly unbound-name::`t0` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool_async.py,line=310,col=9,endLine=310,endColumn=13,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/pool_async.py,line=311,col=16,endLine=311,endColumn=20,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/sched.py,line=96,col=34,endLine=96,endColumn=39,title=Pyrefly unbound-name::`delay` may be uninitialized
+ ::error file=psycopg_pool/psycopg_pool/sched_async.py,line=99,col=48,endLine=99,endColumn=53,title=Pyrefly unbound-name::`delay` may be uninitialized
+ ::error file=tests/fix_db.py,line=96,col=22,endLine=96,endColumn=25,title=Pyrefly unbound-name::`dsn` may be uninitialized
+ ::error file=tests/fix_db.py,line=97,col=12,endLine=97,endColumn=15,title=Pyrefly unbound-name::`dsn` may be uninitialized
+ ::error file=tests/fix_db.py,line=192,col=22,endLine=192,endColumn=26,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=tests/fix_db.py,line=193,col=15,endLine=193,endColumn=19,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=tests/fix_db.py,line=195,col=5,endLine=195,endColumn=9,title=Pyrefly unbound-name::`conn` may be uninitialized
+ ::error file=tests/scripts/pipeline-demo.py,line=105,col=16,endLine=105,endColumn=17,title=Pyrefly unbound-name::`r` may be uninitialized
+ ::error file=tests/scripts/spiketest.py,line=33,col=9,endLine=33,endColumn=12,title=Pyrefly unbound-name::`opt` may be uninitialized
+ ::error file=tests/scripts/spiketest.py,line=34,col=18,endLine=34,endColumn=21,title=Pyrefly unbound-name::`opt` may be uninitialized
+ ::error file=tests/scripts/spiketest.py,line=35,col=18,endLine=35,endColumn=21,title=Pyrefly unbound-name::`opt` may be uninitialized
+ ::error file=tests/scripts/spiketest.py,line=46,col=28,endLine=46,endColumn=31,title=Pyrefly unbound-name::`opt` may be uninitialized
+ ::error file=tests/test_transaction.py,line=613,col=16,endLine=613,endColumn=19,title=Pyrefly unbound-name::`tx3` may be uninitialized
+ ::error file=tests/test_transaction.py,line=613,col=30,endLine=613,endColumn=33,title=Pyrefly unbound-name::`tx3` may be uninitialized
+ ::error file=tests/test_transaction_async.py,line=620,col=16,endLine=620,endColumn=19,title=Pyrefly unbound-name::`tx3` may be uninitialized
+ ::error file=tests/test_transaction_async.py,line=620,col=30,endLine=620,endColumn=33,title=Pyrefly unbound-name::`tx3` may be uninitialized
+ ::error file=tools/update_error_prefixes.py,line=96,col=12,endLine=96,endColumn=15,title=Pyrefly unbound-name::`opt` may be uninitialized

archinstall (https://github.com/archlinux/archinstall)
+ ERROR archinstall/lib/general.py:308:13-20: `old_dir` may be uninitialized [unbound-name]
+ ERROR archinstall/lib/installer.py:198:10-29: `arch_config_handler` may be uninitialized [unbound-name]
+ ERROR archinstall/lib/installer.py:213:10-29: `arch_config_handler` may be uninitialized [unbound-name]
+ ::error file=archinstall/lib/general.py,line=308,col=13,endLine=308,endColumn=20,title=Pyrefly unbound-name::`old_dir` may be uninitialized
+ ::error file=archinstall/lib/installer.py,line=198,col=10,endLine=198,endColumn=29,title=Pyrefly unbound-name::`arch_config_handler` may be uninitialized
+ ::error file=archinstall/lib/installer.py,line=213,col=10,endLine=213,endColumn=29,title=Pyrefly unbound-name::`arch_config_handler` may be uninitialized

cwltool (https://github.com/common-workflow-language/cwltool)
+ ERROR cwltool/docker.py:267:48-57: `file_copy` may be uninitialized [unbound-name]
+ ERROR cwltool/docker.py:298:52-59: `new_dir` may be uninitialized [unbound-name]
+ ERROR cwltool/singularity.py:578:56-63: `new_dir` may be uninitialized [unbound-name]
+ ERROR cwltool/validate_js.py:177:29-40: `jshint_json` may be uninitialized [unbound-name]
+ ERROR cwltool/validate_js.py:186:42-53: `jshint_json` may be uninitialized [unbound-name]
+ ::error file=cwltool/docker.py,line=267,col=48,endLine=267,endColumn=57,title=Pyrefly unbound-name::`file_copy` may be uninitialized
+ ::error file=cwltool/docker.py,line=298,col=52,endLine=298,endColumn=59,title=Pyrefly unbound-name::`new_dir` may be uninitialized
+ ::error file=cwltool/singularity.py,line=578,col=56,endLine=578,endColumn=63,title=Pyrefly unbound-name::`new_dir` may be uninitialized
+ ::error file=cwltool/validate_js.py,line=177,col=29,endLine=177,endColumn=40,title=Pyrefly unbound-name::`jshint_json` may be uninitialized
+ ::error file=cwltool/validate_js.py,line=186,col=42,endLine=186,endColumn=53,title=Pyrefly unbound-name::`jshint_json` may be uninitialized

trio (https://github.com/python-trio/trio)
+ ERROR src/trio/_dtls.py:1100:33-39: `packet` may be uninitialized [unbound-name]
+ ::error file=src/trio/_dtls.py,line=1100,col=33,endLine=1100,endColumn=39,title=Pyrefly unbound-name::`packet` may be uninitialized

colour (https://github.com/colour-science/colour)
+ ERROR colour/appearance/hunt.py:498:63-67: `N_cb` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:499:61-65: `N_cb` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:500:67-71: `N_cb` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:501:65-69: `N_cb` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:513:55-58: `S_p` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:513:60-65: `S_w_p` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:513:67-71: `N_bb` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:514:57-62: `S_w_p` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:514:64-69: `S_w_p` may be uninitialized [unbound-name]
+ ERROR colour/appearance/hunt.py:514:71-75: `N_bb` may be uninitialized [unbound-name]
+ ERROR colour/io/tabular.py:162:19-38: `transposed_csv_file` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1145:13-26: `transmitted_x` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1146:13-26: `transmitted_y` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1157:13-26: `transmitted_x` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1158:13-26: `transmitted_y` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1170:29-42: `transmitted_x` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1173:17-25: `x_center` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1175:17-25: `x_center` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1175:29-37: `x_center` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1181:33-46: `transmitted_x` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1182:28-41: `transmitted_x` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1183:28-41: `transmitted_y` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1184:26-39: `transmitted_y` may be uninitialized [unbound-name]
+ ERROR colour/plotting/phenomena.py:1188:30-45: `theta_interface` may be uninitialized [unbound-name]
+ ::error file=colour/appearance/hunt.py,line=498,col=63,endLine=498,endColumn=67,title=Pyrefly unbound-name::`N_cb` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=499,col=61,endLine=499,endColumn=65,title=Pyrefly unbound-name::`N_cb` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=500,col=67,endLine=500,endColumn=71,title=Pyrefly unbound-name::`N_cb` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=501,col=65,endLine=501,endColumn=69,title=Pyrefly unbound-name::`N_cb` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=513,col=55,endLine=513,endColumn=58,title=Pyrefly unbound-name::`S_p` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=513,col=60,endLine=513,endColumn=65,title=Pyrefly unbound-name::`S_w_p` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=513,col=67,endLine=513,endColumn=71,title=Pyrefly unbound-name::`N_bb` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=514,col=57,endLine=514,endColumn=62,title=Pyrefly unbound-name::`S_w_p` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=514,col=64,endLine=514,endColumn=69,title=Pyrefly unbound-name::`S_w_p` may be uninitialized
+ ::error file=colour/appearance/hunt.py,line=514,col=71,endLine=514,endColumn=75,title=Pyrefly unbound-name::`N_bb` may be uninitialized
+ ::error file=colour/io/tabular.py,line=162,col=19,endLine=162,endColumn=38,title=Pyrefly unbound-name::`transposed_csv_file` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1145,col=13,endLine=1145,endColumn=26,title=Pyrefly unbound-name::`transmitted_x` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1146,col=13,endLine=1146,endColumn=26,title=Pyrefly unbound-name::`transmitted_y` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1157,col=13,endLine=1157,endColumn=26,title=Pyrefly unbound-name::`transmitted_x` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1158,col=13,endLine=1158,endColumn=26,title=Pyrefly unbound-name::`transmitted_y` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1170,col=29,endLine=1170,endColumn=42,title=Pyrefly unbound-name::`transmitted_x` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1173,col=17,endLine=1173,endColumn=25,title=Pyrefly unbound-name::`x_center` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1175,col=17,endLine=1175,endColumn=25,title=Pyrefly unbound-name::`x_center` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1175,col=29,endLine=1175,endColumn=37,title=Pyrefly unbound-name::`x_center` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1181,col=33,endLine=1181,endColumn=46,title=Pyrefly unbound-name::`transmitted_x` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1182,col=28,endLine=1182,endColumn=41,title=Pyrefly unbound-name::`transmitted_x` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1183,col=28,endLine=1183,endColumn=41,title=Pyrefly unbound-name::`transmitted_y` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1184,col=26,endLine=1184,endColumn=39,title=Pyrefly unbound-name::`transmitted_y` may be uninitialized
+ ::error file=colour/plotting/phenomena.py,line=1188,col=30,endLine=1188,endColumn=45,title=Pyrefly unbound-name::`theta_interface` may be uninitialized

schemathesis (https://github.com/schemathesis/schemathesis)
+ ERROR src/schemathesis/cli/commands/__init__.py:125:27-33: `config` may be uninitialized [unbound-name]
+ ::error file=src/schemathesis/cli/commands/__init__.py,line=125,col=27,endLine=125,endColumn=33,title=Pyrefly unbound-name::`config` may be uninitialized

zulip (https://github.com/zulip/zulip)
+ ERROR zerver/actions/create_user.py:628:28-53: `full_members_system_group` may be uninitialized [unbound-name]
+ ERROR zerver/actions/message_send.py:1855:32-42: `topic_name` may be uninitialized [unbound-name]
+ ERROR zerver/management/commands/runtornado.py:140:44-56: `queue_client` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:955:44-48: `iago` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1070:33-37: `iago` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1076:33-37: `iago` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1086:36-41: `shiva` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1093:72-78: `hamlet` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1210:31-40: `desdemona` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1340:12-26: `recipient_type` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1344:14-28: `recipient_type` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1351:14-28: `recipient_type` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1359:38-52: `recipient_type` may be uninitialized [unbound-name]
+ ERROR zilencer/management/commands/populate_db.py:1365:37-51: `recipient_type` may be uninitialized [unbound-name]
+ ::error file=zerver/actions/create_user.py,line=628,col=28,endLine=628,endColumn=53,title=Pyrefly unbound-name::`full_members_system_group` may be uninitialized
+ ::error file=zerver/actions/message_send.py,line=1855,col=32,endLine=1855,endColumn=42,title=Pyrefly unbound-name::`topic_name` may be uninitialized
+ ::error file=zerver/management/commands/runtornado.py,line=140,col=44,endLine=140,endColumn=56,title=Pyrefly unbound-name::`queue_client` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=955,col=44,endLine=955,endColumn=48,title=Pyrefly unbound-name::`iago` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1070,col=33,endLine=1070,endColumn=37,title=Pyrefly unbound-name::`iago` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1076,col=33,endLine=1076,endColumn=37,title=Pyrefly unbound-name::`iago` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1086,col=36,endLine=1086,endColumn=41,title=Pyrefly unbound-name::`shiva` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1093,col=72,endLine=1093,endColumn=78,title=Pyrefly unbound-name::`hamlet` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1210,col=31,endLine=1210,endColumn=40,title=Pyrefly unbound-name::`desdemona` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1340,col=12,endLine=1340,endColumn=26,title=Pyrefly unbound-name::`recipient_type` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1344,col=14,endLine=1344,endColumn=28,title=Pyrefly unbound-name::`recipient_type` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1351,col=14,endLine=1351,endColumn=28,title=Pyrefly unbound-name::`recipient_type` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1359,col=38,endLine=1359,endColumn=52,title=Pyrefly unbound-name::`recipient_type` may be uninitialized
+ ::error file=zilencer/management/commands/populate_db.py,line=1365,col=37,endLine=1365,endColumn=51,title=Pyrefly unbound-name::`recipient_type` may be uninitialized

pyodide (https://github.com/pyodide/pyodide)
+ ERROR pyodide-build/pyodide_build/out_of_tree/pypi.py:220:24-34: `wheel_path` may be uninitialized [unbound-name]
+ ::error file=pyodide-build/pyodide_build/out_of_tree/pypi.py,line=220,col=24,endLine=220,endColumn=34,title=Pyrefly unbound-name::`wheel_path` may be uninitialized

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ERROR ddtrace/contrib/internal/botocore/services/kinesis.py:50:13-22: `data_json` may be uninitialized [unbound-name]
+ ERROR ddtrace/contrib/internal/botocore/services/kinesis.py:52:25-34: `data_json` may be uninitialized [unbound-name]
+ ERROR ddtrace/contrib/internal/botocore/services/kinesis.py:56:26-35: `data_json` may be uninitialized [unbound-name]
+ ERROR ddtrace/contrib/internal/langgraph/patch.py:448:16-24: `prebuilt` may be uninitialized [unbound-name]
+ ERROR ddtrace/internal/symbol_db/remoteconfig.py:38:13-17: `pids` may be uninitialized [unbound-name]
+ ERROR ddtrace/internal/symbol_db/remoteconfig.py:38:21-24: `pid` may be uninitialized [unbound-name]
+ ERROR ddtrace/llmobs/_integrations/bedrock.py:131:33-52: `additional_metadata` may be uninitialized [unbound-name]
+ ERROR ddtrace/llmobs/_integrations/bedrock.py:132:38-60: `streamed_usage_metrics` may be uninitialized [unbound-name]
+ ERROR scripts/import-analysis/cycles.py:84:17-27: `new_cycles` may be uninitialized [unbound-name]
+ ERROR tests/appsec/appsec_utils.py:413:24-26: `os` may be uninitialized [unbound-name]
+ ERROR tests/appsec/appsec_utils.py:414:25-27: `os` may be uninitialized [unbound-name]
+ ERROR tests/appsec/appsec_utils.py:414:35-37: `os` may be uninitialized [unbound-name]
+ ERROR tests/appsec/appsec_utils.py:423:17-19: `os` may be uninitialized [unbound-name]
+ ERROR tests/appsec/appsec_utils.py:423:27-29: `os` may be uninitialized [unbound-name]
+ ERROR tests/appsec/iast_tdd_propagation/test_flask.py:81:20-36: `tainted_response` may be uninitialized [unbound-name]
+ ERROR tests/appsec/iast_tdd_propagation/test_flask.py:82:34-50: `tainted_response` may be uninitialized [unbound-name]
+ ERROR tests/contrib/integration_registry/test_riotfile.py:54:42-58: `failure_messages` may be uninitialized [unbound-name]
+ ERROR tests/contrib/psycopg/test_psycopg.py:178:23-41: `patched_connection` may be uninitialized [unbound-name]
+ ERROR tests/contrib/psycopg2/test_psycopg.py:185:23-41: `patched_connection` may be uninitialized [unbound-name]
+ ERROR tests/internal/crashtracker/test_crashtracker.py:95:30-32: `ct` may be uninitialized [unbound-name]
+ ERROR tests/internal/crashtracker/test_crashtracker.py:126:30-32: `ct` may be uninitialized [unbound-name]
+ ERROR tests/llmobs/conftest.py:127:19-24: `ragas` may be uninitialized [unbound-name]
+ ERROR tests/llmobs/conftest.py:136:20-25: `ragas` may be uninitialized [unbound-name]
+ ERROR tests/llmobs/conftest.py:138:5-10: `ragas` may be uninitialized [unbound-name]
+ ::error file=ddtrace/contrib/internal/botocore/services/kinesis.py,line=50,col=13,endLine=50,endColumn=22,title=Pyrefly unbound-name::`data_json` may be uninitialized
+ ::error file=ddtrace/contrib/internal/botocore/services/kinesis.py,line=52,col=25,endLine=52,endColumn=34,title=Pyrefly unbound-name::`data_json` may be uninitialized
+ ::error file=ddtrace/contrib/internal/botocore/services/kinesis.py,line=56,col=26,endLine=56,endColumn=35,title=Pyrefly unbound-name::`data_json` may be uninitialized
+ ::error file=ddtrace/contrib/internal/langgraph/patch.py,line=448,col=16,endLine=448,endColumn=24,title=Pyrefly unbound-name::`prebuilt` may be uninitialized
+ ::error file=ddtrace/internal/symbol_db/remoteconfig.py,line=38,col=13,endLine=38,endColumn=17,title=Pyrefly unbound-name::`pids` may be uninitialized
+ ::error file=ddtrace/internal/symbol_db/remoteconfig.py,line=38,col=21,endLine=38,endColumn=24,title=Pyrefly unbound-name::`pid` may be uninitialized
+ ::error file=ddtrace/llmobs/_integrations/bedrock.py,line=131,col=33,endLine=131,endColumn=52,title=Pyrefly unbound-name::`additional_metadata` may be uninitialized
+ ::error file=ddtrace/llmobs/_integrations/bedrock.py,line=132,col=38,endLine=132,endColumn=60,title=Pyrefly unbound-name::`streamed_usage_metrics` may be uninitialized
+ ::error file=scripts/import-analysis/cycles.py,line=84,col=17,endLine=84,endColumn=27,title=Pyrefly unbound-name::`new_cycles` may be uninitialized
+ ::error file=tests/appsec/appsec_utils.py,line=413,col=24,endLine=413,endColumn=26,title=Pyrefly unbound-name::`os` may be uninitialized
+ ::error file=tests/appsec/appsec_utils.py,line=414,col=25,endLine=414,endColumn=27,title=Pyrefly unbound-name::`os` may be uninitialized
+ ::error file=tests/appsec/appsec_utils.py,line=414,col=35,endLine=414,endColumn=37,title=Pyrefly unbound-name::`os` may be uninitialized
+ ::error file=tests/appsec/appsec_utils.py,line=423,col=17,endLine=423,endColumn=19,title=Pyrefly unbound-name::`os` may be uninitialized
+ ::error file=tests/appsec/appsec_utils.py,line=423,col=27,endLine=423,endColumn=29,title=Pyrefly unbound-name::`os` may be uninitialized
+ ::error file=tests/appsec/iast_tdd_propagation/test_flask.py,line=81,col=20,endLine=81,endColumn=36,title=Pyrefly unbound-name::`tainted_response` may be uninitialized
+ ::error file=tests/appsec/iast_tdd_propagation/test_flask.py,line=82,col=34,endLine=82,endColumn=50,title=Pyrefly unbound-name::`tainted_response` may be uninitialized
+ ::error file=tests/contrib/integration_registry/test_riotfile.py,line=54,col=42,endLine=54,endColumn=58,title=Pyrefly unbound-name::`failure_messages` may be uninitialized
+ ::error file=tests/contrib/psycopg/test_psycopg.py,line=178,col=23,endLine=178,endColumn=41,title=Pyrefly unbound-name::`patched_connection` may be uninitialized
+ ::error file=tests/contrib/psycopg2/test_psycopg.py,line=185,col=23,endLine=185,endColumn=41,title=Pyrefly unbound-name::`patched_connection` may be uninitialized
+ ::error file=tests/internal/crashtracker/test_crashtracker.py,line=95,col=30,endLine=95,endColumn=32,title=Pyrefly unbound-name::`ct` may be uninitialized
+ ::error file=tests/internal/crashtracker/test_crashtracker.py,line=126,col=30,endLine=126,endColumn=32,title=Pyrefly unbound-name::`ct` may be uninitialized
+ ::error file=tests/llmobs/conftest.py,line=127,col=19,endLine=127,endColumn=24,title=Pyrefly unbound-name::`ragas` may be uninitialized
+ ::error file=tests/llmobs/conftest.py,line=136,col=20,endLine=136,endColumn=25,title=Pyrefly unbound-name::`ragas` may be uninitialized
+ ::error file=tests/llmobs/conftest.py,line=138,col=5,endLine=138,endColumn=10,title=Pyrefly unbound-name::`ragas` may be uninitialized

mkosi (https://github.com/systemd/mkosi)
+ ERROR mkosi/__init__.py:1618:23-27: `arch` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:1771:17-22: `ukify` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:1831:17-22: `ukify` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:1888:27-34: `version` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:4426:10-19: `tool_path` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:4426:33-39: `output` may be uninitialized [unbound-name]
+ ERROR mkosi/__init__.py:4426:65-71: `output` may be uninitialized [unbound-name]
+ ERROR mkosi/bootloader.py:395:52-58: `signed` may be uninitialized [unbound-name]
+ ERROR mkosi/distribution/fedora.py:57:23-38: `rawhide_will_be` may be uninitialized [unbound-name]
+ ERROR mkosi/qemu.py:1428:28-29: `p` may be uninitialized [unbound-name]
+ ERROR mkosi/sysupdate.py:71:13-22: `sysupdate` may be uninitialized [unbound-name]
+ ::error file=mkosi/__init__.py,line=1618,col=23,endLine=1618,endColumn=27,title=Pyrefly unbound-name::`arch` may be uninitialized
+ ::error file=mkosi/__init__.py,line=1771,col=17,endLine=1771,endColumn=22,title=Pyrefly unbound-name::`ukify` may be uninitialized
+ ::error file=mkosi/__init__.py,line=1831,col=17,endLine=1831,endColumn=22,title=Pyrefly unbound-name::`ukify` may be uninitialized
+ ::error file=mkosi/__init__.py,line=1888,col=27,endLine=1888,endColumn=34,title=Pyrefly unbound-name::`version` may be uninitialized
+ ::error file=mkosi/__init__.py,line=4426,col=10,endLine=4426,endColumn=19,title=Pyrefly unbound-name::`tool_path` may be uninitialized
+ ::error file=mkosi/__init__.py,line=4426,col=33,endLine=4426,endColumn=39,title=Pyrefly unbound-name::`output` may be uninitialized
+ ::error file=mkosi/__init__.py,line=4426,col=65,endLine=4426,endColumn=71,title=Pyrefly unbound-name::`output` may be uninitialized
+ ::error file=mkosi/bootloader.py,line=395,col=52,endLine=395,endColumn=58,title=Pyrefly unbound-name::`signed` may be uninitialized
+ ::error file=mkosi/distribution/fedora.py,line=57,col=23,endLine=57,endColumn=38,title=Pyrefly unbound-name::`rawhide_will_be` may be uninitialized
+ ::error file=mkosi/qemu.py,line=1428,col=28,endLine=1428,endColumn=29,title=Pyrefly unbound-name::`p` may be uninitialized
+ ::error file=mkosi/sysupdate.py,line=71,col=13,endLine=71,endColumn=22,title=Pyrefly unbound-name::`sysupdate` may be uninitialized

check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
+ ERROR src/check_jsonschema/cli/param_types.py:112:34-40: `result` may be uninitialized [unbound-name]
+ ERROR src/check_jsonschema/cli/param_types.py:120:27-33: `result` may be uninitialized [unbound-name]
+ ERROR src/check_jsonschema/cli/param_types.py:123:63-69: `result` may be uninitialized [unbound-name]
+ ::error file=src/check_jsonschema/cli/param_types.py,line=112,col=34,endLine=112,endColumn=40,title=Pyrefly unbound-name::`result` may be uninitialized
+ ::error file=src/check_jsonschema/cli/param_types.py,line=120,col=27,endLine=120,endColumn=33,title=Pyrefly unbound-name::`result` may be uninitialized
+ ::error file=src/check_jsonschema/cli/param_types.py,line=123,col=63,endLine=123,endColumn=69,title=Pyrefly unbound-name::`result` may be uninitialized

yarl (https://github.com/aio-libs/yarl)
+ ERROR yarl/_url.py:1057:16-22: `netloc` may be uninitialized [unbound-name]
+ ERROR yarl/_url.py:1058:45-51: `netloc` may be uninitialized [unbound-name]
+ ERROR yarl/_url.py:1064:41-47: `netloc` may be uninitialized [unbound-name]
+ ::error file=yarl/_url.py,line=1057,col=16,endLine=1057,endColumn=22,title=Pyrefly unbound-name::`netloc` may be uninitialized
+ ::error file=yarl/_url.py,line=1058,col=45,endLine=1058,endColumn=51,title=Pyrefly unbound-name::`netloc` may be uninitialized
+ ::error file=yarl/_url.py,line=1064,col=41,endLine=1064,endColumn=47,title=Pyrefly unbound-name::`netloc` may be uninitialized

pandera (https://github.com/pandera-dev/pandera)
+ ERROR tests/geopandas/test_from_to_format_conversions.py:311:35-38: `out` may be uninitialized [unbound-name]
+ ERROR tests/geopandas/test_from_to_format_conversions.py:312:23-26: `out` may be uninitialized [unbound-name]
+ ERROR tests/geopandas/test_from_to_format_conversions.py:313:23-26: `out` may be uninitialized [unbound-name]
+ ERROR tests/pandas/test_from_to_format_conversions.py:300:35-38: `out` may be uninitialized [unbound-name]
+ ERROR tests/pandas/test_from_to_format_conversions.py:301:23-26: `out` may be uninitialized [unbound-name]
+ ERROR tests/pandas/test_from_to_format_conversions.py:302:22-25: `out` may be uninitialized [unbound-name]
+ ::error file=tests/geopandas/test_from_to_format_conversions.py,line=311,col=35,endLine=311,endColumn=38,title=Pyrefly unbound-name::`out` may be uninitialized
+ ::error file=tests/geopandas/test_from_to_format_conversions.py,line=312,col=23,endLine=312,endColumn=26,title=Pyrefly unbound-name::`out` may be uninitialized
+ ::error file=tests/geopandas/test_from_to_format_conversions.py,line=313,col=23,endLine=313,endColumn=26,title=Pyrefly unbound-name::`out` may be uninitialized
+ ::error file=tests/pandas/test_from_to_format_conversions.py,line=300,col=35,endLine=300,endColumn=38,title=Pyrefly unbound-name::`out` may be uninitialized
+ ::error file=tests/pandas/test_from_to_format_conversions.py,line=301,col=23,endLine=301,endColumn=26,title=Pyrefly unbound-name::`out` may be uninitialized
+ ::error file=tests/pandas/test_from_to_format_conversions.py,line=302,col=22,endLine=302,endColumn=25,title=Pyrefly unbound-name::`out` may be uninitialized

pyppeteer (https://github.com/pyppeteer/pyppeteer)
+ ERROR pyppeteer/execution_context.py:90:32-36: `_obj` may be uninitialized [unbound-name]
+ ERROR pyppeteer/execution_context.py:95:28-32: `_obj` may be uninitialized [unbound-name]
+ ERROR pyppeteer/execution_context.py:110:28-32: `_obj` may be uninitialized [unbound-name]
+ ERROR pyppeteer/execution_context.py:114:24-28: `_obj` may be uninitialized [unbound-name]
+ ::error file=pyppeteer/execution_context.py,line=90,col=32,endLine=90,endColumn=36,title=Pyrefly unbound-name::`_obj` may be uninitialized
+ ::error file=pyppeteer/execution_context.py,line=95,col=28,endLine=95,endColumn=32,title=Pyrefly unbound-name::`_obj` may be uninitialized
+ ::error file=pyppeteer/execution_context.py,line=110,col=28,endLine=110,endColumn=32,title=Pyrefly unbound-name::`_obj` may be uninitialized
+ ::error file=pyppeteer/execution_context.py,line=114,col=24,endLine=114,endColumn=28,title=Pyrefly unbound-name::`_obj` may be uninitialized

streamlit (https://github.com/streamlit/streamlit)
+ ERROR lib/streamlit/config_util.py:628:24-28: `toml` may be uninitialized [unbound-name]
+ ::error file=lib/streamlit/config_util.py,line=628,col=24,endLine=628,endColumn=28,title=Pyrefly unbound-name::`toml` may be uninitialized

dragonchain (https://github.com/dragonchain/dragonchain)
+ ERROR dragonchain/broadcast_processor/broadcast_processor.py:284:119-127: `chain_id` may be uninitialized [unbound-name]
+ ERROR dragonchain/broadcast_processor/broadcast_processor.py:321:123-131: `chain_id` may be uninitialized [unbound-name]
+ ERROR dragonchain/contract_invoker/contract_invoker_service.py:64:42-61: `invocation_response` may be uninitialized [unbound-name]
+ ERROR dragonchain/contract_invoker/contract_invoker_service.py:69:47-66: `invocation_response` may be uninitialized [unbound-name]
+ ERROR dragonchain/lib/broadcast.py:87:16-17: `r` may be uninitialized [unbound-name]
+ ERROR dragonchain/lib/broadcast.py:91:25-26: `r` may be uninitialized [unbound-name]
+ ::error file=dragonchain/broadcast_processor/broadcast_processor.py,line=284,col=119,endLine=284,endColumn=127,title=Pyrefly unbound-name::`chain_id` may be uninitialized
+ ::error file=dragonchain/broadcast_processor/broadcast_processor.py,line=321,col=123,endLine=321,endColumn=131,title=Pyrefly unbound-name::`chain_id` may be uninitialized
+ ::error file=dragonchain/contract_invoker/contract_invoker_service.py,line=64,col=42,endLine=64,endColumn=61,title=Pyrefly unbound-name::`invocation_response` may be uninitialized
+ ::error file=dragonchain/contract_invoker/contract_invoker_service.py,line=69,col=47,endLine=69,endColumn=66,title=Pyrefly unbound-name::`invocation_response` may be uninitialized
+ ::error file=dragonchain/lib/broadcast.py,line=87,col=16,endLine=87,endColumn=17,title=Pyrefly unbound-name::`r` may be uninitialized
+ ::error file=dragonchain/lib/broadcast.py,line=91,col=25,endLine=91,endColumn=26,title=Pyrefly unbound-name::`r` may be uninitialized

paasta (https://github.com/yelp/paasta)
+ ERROR paasta_tools/cli/cmds/autoscale.py:245:19-25: `status` may be uninitialized [unbound-name]
+ ERROR paasta_tools/cli/cmds/autoscale.py:260:35-41: `status` may be uninitialized [unbound-name]
+ ERROR paasta_tools/cli/cmds/status.py:1056:52-65: `dashboard_url` may be uninitialized [unbound-name]
+ ERROR paasta_tools/paastaapi/model_utils.py:1676:48-54: `kwargs` may be uninitialized [unbound-name]
+ ERROR paasta_tools/utils.py:2961:13-22: `proctimer` may be uninitialized [unbound-name]
+ ::error file=paasta_tools/cli/cmds/autoscale.py,line=245,col=19,endLine=245,endColumn=25,title=Pyrefly unbound-name::`status` may be uninitialized
+ ::error file=paasta_tools/cli/cmds/autoscale.py,line=260,col=35,endLine=260,endColumn=41,title=Pyrefly unbound-name::`status` may be uninitialized
+ ::error file=paasta_tools/cli/cmds/status.py,line=1056,col=52,endLine=1056,endColumn=65,title=Pyrefly unbound-name::`dashboard_url` may be uninitialized
+ ::error file=paasta_tools/paastaapi/model_utils.py,line=1676,col=48,endLine=1676,endColumn=54,title=Pyrefly unbound-name::`kwargs` may be uninitialized
+ ::error file=paasta_tools/utils.py,line=2961,col=13,endLine=2961,endColumn=22,title=Pyrefly unbound-name::`proctimer` may be uninitialized

isort (https://github.com/pycqa/isort)
+ ERROR isort/api.py:206:33-45: `file_content` may be uninitialized [unbound-name]
+ ::error file=isort/api.py,line=206,col=33,endLine=206,endColumn=45,title=Pyrefly unbound-name::`file_content` may be uninitialized

vision (https://github.com/pytorch/vision)
+ ERROR references/optical_flow/train.py:256:35-45: `checkpoint` may be uninitialized [unbound-name]
+ ERROR references/optical_flow/train.py:257:35-45: `checkpoint` may be uninitialized [unbound-name]
+ ERROR references/optical_flow/train.py:258:28-38: `checkpoint` may be uninitialized [unbound-name]
+ ERROR test/test_videoapi.py:257:26-36: `video_path` may be uninitialized [unbound-name]
+ ERROR test/test_videoapi.py:261:19-29: `video_path` may be uninitialized [unbound-name]
+ ::error file=references/optical_flow/train.py,line=256,col=35,endLine=256,endColumn=45,title=Pyrefly unbound-name::`checkpoint` may be uninitialized
+ ::error file=references/optical_flow/train.py,line=257,col=35,endLine=257,endColumn=45,title=Pyrefly unbound-name::`checkpoint` may be uninitialized
+ ::error file=references/optical_flow/train.py,line=258,col=28,endLine=258,endColumn=38,title=Pyrefly unbound-name::`checkpoint` may be uninitialized
+ ::error file=test/test_videoapi.py,line=257,col=26,endLine=257,endColumn=36,title=Pyrefly unbound-name::`video_path` may be uninitialized
+ ::error file=test/test_videoapi.py,line=261,col=19,endLine=261,endColumn=29,title=Pyrefly unbound-name::`video_path` may be uninitialized

bokeh (https://github.com/bokeh/bokeh)
+ ERROR src/bokeh/plotting/contour.py:260:28-36: `fill_cds` may be uninitialized [unbound-name]
+ ERROR src/bokeh/plotting/contour.py:268:28-40: `line_visuals` may be uninitialized [unbound-name]
+ ERROR src/bokeh/plotting/contour.py:272:28-36: `line_cds` may be uninitialized [unbound-name]
+ ERROR src/bokeh/sphinxext/_internal/bokeh_jinja.py:89:28-34: `module` may be uninitialized [unbound-name]
+ ::error file=src/bokeh/plotting/contour.py,line=260,col=28,endLine=260,endColumn=36,title=Pyrefly unbound-name::`fill_cds` may be uninitialized
+ ::error file=src/bokeh/plotting/contour.py,line=268,col=28,endLine=268,endColumn=40,title=Pyrefly unbound-name::`line_visuals` may be uninitialized
+ ::error file=src/bokeh/plotting/contour.py,line=272,col=28,endLine=272,endColumn=36,title=Pyrefly unbound-name::`line_cds` may be uninitialized
+ ::error file=src/bokeh/sphinxext/_internal/bokeh_jinja.py,line=89,col=28,endLine=89,endColumn=34,title=Pyrefly unbound-name::`module` may be uninitialized

pandas (https://github.com/pandas-dev/pandas)
+ ERROR pandas/core/common.py:593:32-41: `old_value` may be uninitialized [unbound-name]
+ ERROR pandas/core/groupby/ops.py:501:32-38: `counts` may be uninitialized [unbound-name]
+ ERROR pandas/core/indexes/datetimelike.py:483:58-62: `reso` may be uninitialized [unbound-name]
+ ERROR pandas/core/indexes/datetimelike.py:483:64-70: `parsed` may be uninitialized [unbound-name]
+ ERROR pandas/tests/io/test_iceberg.py:64:9-20: `config_path` may be uninitialized [unbound-name]
+ ERROR pandas/tests/io/test_pickle.py:242:22-23: `f` may be uninitialized [unbound-name]
+ ERROR pandas/tests/io/test_pickle.py:243:21-22: `f` may be uninitialized [unbound-name]
+ ERROR pandas/tests/tseries/offsets/test_offsets_properties.py:58:40-47: `compare` may be uninitialized [unbound-name]
+ ::error file=pandas/core/common.py,line=593,col=32,endLine=593,endColumn=41,title=Pyrefly unbound-name::`old_value` may be uninitialized
+ ::error file=pandas/core/groupby/ops.py,line=501,col=32,endLine=501,endColumn=38,title=Pyrefly unbound-name::`counts` may be uninitialized
+ ::error file=pandas/core/indexes/datetimelike.py,line=483,col=58,endLine=483,endColumn=62,title=Pyrefly unbound-name::`reso` may be uninitialized
+ ::error file=pandas/core/indexes/datetimelike.py,line=483,col=64,endLine=483,endColumn=70,title=Pyrefly unbound-name::`parsed` may be uninitialized
+ ::error file=pandas/tests/io/test_iceberg.py,line=64,col=9,endLine=64,endColumn=20,title=Pyrefly unbound-name::`config_path` may be uninitialized
+ ::error file=pandas/tests/io/test_pickle.py,line=242,col=22,endLine=242,endColumn=23,title=Pyrefly unbound-name::`f` may be uninitialized
+ ::error file=pandas/tests/io/test_pickle.py,line=243,col=21,endLine=243,endColumn=22,title=Pyrefly unbound-name::`f` may be uninitialized
+ ::error file=pandas/tests/tseries/offsets/test_offsets_properties.py,line=58,col=40,endLine=58,endColumn=47,title=Pyrefly unbound-name::`compare` may be uninitialized

prefect (https://github.com/PrefectHQ/prefect)
+ ERROR src/prefect/cli/dashboard.py:27:62-68: `ui_url` may be uninitialized [unbound-name]
+ ERROR src/prefect/cli/dashboard.py:29:33-39: `ui_url` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2375:26-30: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2376:24-28: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2377:29-33: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2387:17-21: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2388:28-32: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/flows.py:2397:54-58: `flow` may be uninitialized [unbound-name]
+ ERROR src/prefect/task_engine.py:773:32-42: `log_prints` may be uninitialized [unbound-name]
+ ERROR src/prefect/task_engine.py:1379:32-42: `log_prints` may be uninitialized [unbound-name]
+ ERROR src/integrations/prefect-docker/prefect_docker/deployments/steps.py:113:12-24: `ignore_cache` may be uninitialized [unbound-name]
+ ERROR src/integrations/prefect-email/prefect_email/credentials.py:217:13-19: `server` may be uninitialized [unbound-name]
+ ERROR src/integrations/prefect-email/prefect_email/credentials.py:219:16-22: `server` may be uninitialized [unbound-name]
+ ::error file=src/prefect/cli/dashboard.py,line=27,col=62,endLine=27,endColumn=68,title=Pyrefly unbound-name::`ui_url` may be uninitialized
+ ::error file=src/prefect/cli/dashboard.py,line=29,col=33,endLine=29,endColumn=39,title=Pyrefly unbound-name::`ui_url` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2375,col=26,endLine=2375,endColumn=30,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2376,col=24,endLine=2376,endColumn=28,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2377,col=29,endLine=2377,endColumn=33,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2387,col=17,endLine=2387,endColumn=21,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2388,col=28,endLine=2388,endColumn=32,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/flows.py,line=2397,col=54,endLine=2397,endColumn=58,title=Pyrefly unbound-name::`flow` may be uninitialized
+ ::error file=src/prefect/task_engine.py,line=773,col=32,endLine=773,endColumn=42,title=Pyrefly unbound-name::`log_prints` may be uninitialized
+ ::error file=src/prefect/task_engine.py,line=1379,col=32,endLine=1379,endColumn=42,title=Pyrefly unbound-name::`log_prints` may be uninitialized
+ ::error file=src/integrations/prefect-docker/prefect_docker/deployments/steps.py,line=113,col=12,endLine=113,endColumn=24,title=Pyrefly unbound-name::`ignore_cache` may be uninitialized
+ ::error file=src/integrations/prefect-email/prefect_email/credentials.py,line=217,col=13,endLine=217,endColumn=19,title=Pyrefly unbound-name::`server` may be uninitialized
+ ::error file=src/integrations/prefect-email/prefect_email/credentials.py,line=219,col=16,endLine=219,endColumn=22,title=Pyrefly unbound-name::`server` may be uninitialized

setuptools (https://github.com/pypa/setuptools)
+ ERROR setuptools/_distutils/command/bdist_rpm.py:319:22-29: `rpm_dir` may be uninitialized [unbound-name]
+ ERROR setuptools/_distutils/command/bdist_rpm.py:388:37-44: `rpm_dir` may be uninitialized [unbound-name]
+ ERROR setuptools/_distutils/command/bdist_rpm.py:396:40-47: `rpm_dir` may be uninitialized [unbound-name]
+ ERROR setuptools/_distutils/tests/test_check.py:36:22-29: `old_dir` may be uninitialized [unbound-name]
+ ::error file=setuptools/_distutils/command/bdist_rpm.py,line=319,col=22,endLine=319,endColumn=29,title=Pyrefly unbound-name::`rpm_dir` may be uninitialized
+ ::error file=setuptools/_distutils/command/bdist_rpm.py,line=388,col=37,endLine=388,endColumn=44,title=Pyrefly unbound-name::`rpm_dir` may be uninitialized
+ ::error file=setuptools/_distutils/command/bdist_rpm.py,line=396,col=40,endLine=396,endColumn=47,title=Pyrefly unbound-name::`rpm_dir` may be uninitialized
+ ::error file=setuptools/_distutils/tests/test_check.py,line=36,col=22,endLine=36,endColumn=29,title=Pyrefly unbound-name::`old_dir` may be uninitialized

static-frame (https://github.com/static-frame/static-frame)
- ERROR static_frame/core/frame.py:2521:61-62: Argument `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` is not assignable to parameter `array` with type `ndarray[Any, Any]` in function `static_frame.core.store_filter.StoreFilter.to_type_filter_array` [bad-argument-type]
- ERROR static_frame/core/frame.py:2543:59-60: Argument `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` is not assignable to parameter `array` with type `ndarray[Any, Any]` in function `static_frame.core.store_filter.StoreFilter.to_type_filter_array` [bad-argument-type]
- ERROR static_frame/core/frame.py:2550:21-35: Argument `list[TIndexInitializer] | list[ndarray[Any, Any]]` is not assignable to parameter `value` with type `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` in function `static_frame.core.container_util.index_from_optional_constructors` [bad-argument-type]
+ ERROR static_frame/core/frame.py:2550:21-35: Argument `list[ndarray[Any, Any]] | list[Unknown]` is not assignable to parameter `value` with type `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` in function `static_frame.core.container_util.index_from_optional_constructors` [bad-argument-type]
+ ERROR static_frame/core/util.py:3674:29-34: `state` may be uninitialized [unbound-name]
- ::error file=static_frame/core/frame.py,line=2521,col=61,endLine=2521,endColumn=62,title=Pyrefly bad-argument-type::Argument `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` is not assignable to parameter `array` with type `ndarray[Any, Any]` in function `static_frame.core.store_filter.StoreFilter.to_type_filter_array`
- ::error file=static_frame/core/frame.py,line=2543,col=59,endLine=2543,endColumn=60,title=Pyrefly bad-argument-type::Argument `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` is not assignable to parameter `array` with type `ndarray[Any, Any]` in function `static_frame.core.store_filter.StoreFilter.to_type_filter_array`
- ::error file=static_frame/core/frame.py,line=2550,col=21,endLine=2550,endColumn=35,title=Pyrefly bad-argument-type::Argument `list[TIndexInitializer] | list[ndarray[Any, Any]]` is not assignable to parameter `value` with type `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` in function `static_frame.core.container_util.index_from_optional_constructors`
+ ::error file=static_frame/core/frame.py,line=2550,col=21,endLine=2550,endColumn=35,title=Pyrefly bad-argument-type::Argument `list[ndarray[Any, Any]] | list[Unknown]` is not assignable to parameter `value` with type `IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]` in function `static_frame.core.container_util.index_from_optional_constructors`
+ ::error file=static_frame/core/util.py,line=3674,col=29,endLine=3674,endColumn=34,title=Pyrefly unbound-name::`state` may be uninitialized

materialize (https://github.com/MaterializeInc/materialize)
+ ERROR misc/python/materialize/mzbuild.py:1547:12-22: `ghcr_token` may be uninitialized [unbound-name]
+ ::error file=misc/python/materialize/mzbuild.py,line=1547,col=12,endLine=1547,endColumn=22,title=Pyrefly unbound-name::`ghcr_token` may be uninitialized

async-utils (https://github.com/mikeshardmind/async-utils)
+ ERROR src/async_utils/lockout.py:103:16-25: `sleep_for` may be uninitialized [unbound-name]
+ ERROR src/async_utils/lockout.py:104:37-46: `sleep_for` may be uninitialized [unbound-name]
+ ::error file=src/async_utils/lockout.py,line=103,col=16,endLine=103,endColumn=25,title=Pyrefly unbound-name::`sleep_for` may be uninitialized
+ ::error file=src/async_utils/lockout.py,line=104,col=37,endLine=104,endColumn=46,title=Pyrefly unbound-name::`sleep_for` may be uninitialized

cryptography (https://github.com/pyca/cryptography)
+ ERROR src/cryptography/hazmat/primitives/serialization/ssh.py:750:48-51: `tag` may be uninitialized [unbound-name]
+ ::error file=src/cryptography/hazmat/primitives/serialization/ssh.py,line=750,col=48,endLine=750,endColumn=51,title=Pyrefly unbound-name::`tag` may be uninitialized

mypy (https://github.com/python/mypy)
+ ERROR mypy/semanal.py:2043:36-53: `type_params_names` may be uninitialized [unbound-name]
+ ERROR mypy/test/testpep561.py:163:23-30: `program` may be uninitialized [unbound-name]
+ ERROR mypyc/codegen/emitclass.py:414:64-82: `shadow_vtable_name` may be uninitialized [unbound-name]
+ ERROR mypyc/irbuild/ll_builder.py:932:28-32: `skip` may be uninitialized [unbound-name]
+ ERROR mypyc/irbuild/ll_builder.py:933:41-45: `skip` may be uninitialized [unbound-name]
+ ERROR mypyc/irbuild/ll_builder.py:2596:37-48: `false_block` may be uninitialized [unbound-name]
+ ::error file=mypy/semanal.py,line=2043,col=36,endLine=2043,endColumn=53,title=Pyrefly unbound-name::`type_params_names` may be uninitialized
+ ::error file=mypy/test/testpep561.py,line=163,col=23,endLine=163,endColumn=30,title=Pyrefly unbound-name::`program` may be uninitialized
+ ::error file=mypyc/codegen/emitclass.py,line=414,col=64,endLine=414,endColumn=82,title=Pyrefly unbound-name::`shadow_vtable_name` may be uninitialized
+ ::error file=mypyc/irbuild/ll_builder.py,line=932,col=28,endLine=932,endColumn=32,title=Pyrefly unbound-name::`skip` may be uninitialized
+ ::error file=mypyc/irbuild/ll_builder.py,line=933,col=41,endLine=933,endColumn=45,title=Pyrefly unbound-name::`skip` may be uninitialized

... (truncated 159 lines) ...```

@stroxler
Copy link
Contributor

stroxler commented Jan 12, 2026

Thanks for the PR! I'm not entirely sure when I'll get to this - I likely have a competing fix as part of some active work on match exhaustiveness, which is why I had assigned the issue to myself.

I'll try to take a look later this week, but I may wind up closing this PR because my existing work (and the fact that it's intertwined with match logic) might take precedence.

From a skim, the fix looks pretty good to me

@stroxler stroxler self-assigned this Jan 12, 2026
@stroxler
Copy link
Contributor

(Just as a general note - if an issue is assigned I'd recommend pinging the assignee before you take it on - this often means someone is already working on a fix, or they believe the issue needs to be part of a bigger chunk of changes rather than tackled as a one-off)

@jackulau
Copy link
Contributor Author

Thanks for the heads up, I'll keep that in mind for future contributions!

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.

False negatives in uninitialized local detection for branches that end in function calls (due to unknown Never/NoReturn status)

2 participants