Skip to content

Implement ty fixes#586

Merged
svij-sc merged 21 commits into
svij/use-tyfrom
svij/use-ty-fixes
May 14, 2026
Merged

Implement ty fixes#586
svij-sc merged 21 commits into
svij/use-tyfrom
svij/use-ty-fixes

Conversation

@svij-sc
Copy link
Copy Markdown
Collaborator

@svij-sc svij-sc commented Apr 13, 2026

ty was introduced here: #585

This PR introduces relevant fixes for type check to pass.

@svij-sc svij-sc changed the base branch from main to svij/use-ty April 13, 2026 22:52
svij-sc and others added 2 commits April 15, 2026 00:59
Fixes all type errors found by ty after the mypy→ty migration:

- Remove redundant cast() calls (graph_data_types.py, eval_metrics.py)
- Fix `raise NotImplemented` → `raise NotImplementedError` (graph_dataset.py)
- Add explicit `import concurrent.futures` and `import absl.logging`
- Use `isinstance()` instead of `type() ==` for proper type narrowing (file_loader.py)
- Remove _Comparable protocol bound from SortedDict (sorted_dict.py)
- Add ty: ignore comments for unresolvable type narrowing cases
- Promote all ty rules back to default error severity
- Add overrides to suppress errors in generated *_pb2.py files
- Exclude notebooks from type checking

Co-Authored-By: shubhamvij <25601958+shubhamvij@users.noreply.github.com>
@svij-sc svij-sc force-pushed the svij/use-ty-fixes branch from ad2986a to 43536db Compare April 15, 2026 01:00
@semgrep-code-snapchat
Copy link
Copy Markdown

Semgrep found 1 github-script-injection finding:

  • .github/actions/assert-is-collaborator/action.yml

Using variable interpolation ${{...}} with github context data in a actions/github-script's script: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

Co-authored-by: kmontemayor <kyle.e.montemayor@gmail.com>
Co-authored-by: svij <svij@snapchat.com>
@svij-sc svij-sc merged commit 5dd0996 into svij/use-ty May 14, 2026
7 checks passed
@svij-sc svij-sc deleted the svij/use-ty-fixes branch May 14, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants