Skip to content

Conversation

@relud
Copy link
Contributor

@relud relud commented Jan 30, 2026

type dict wasn't enough for cirrus' pyright, it threw

Type of "merge" is "(feature_configs: dict[str, dict[Unknown, Unknown]]) -> MergedJsonWithErrors"

I've confirmed manually that this clears up the issue

I tried to do this originally, but used dict and Any and it didn't work because I didn't realize I needed to use typing.Dict and typing.Any

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Looks good, just one suggestion. However you want to deal with that is good with me, I don't need to re-review.

into_custom = "json.loads({})"
from_custom = "json.dumps({})"
type_name = "dict"
type_name = "typing.Dict[str, typing.Any]"
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to add typing to the imports list. I think this currently works because UniFFI imports typing for its own purposes, but that feels a bit fragile. Double-check me though, I could definitely be wrong about the exact config needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it causes typing to be imported twice, but it works, and I like not depending on uniffi to implicitly import typing given that it has real potential to not be imported in the future if uniffi doesn't need it

@relud relud added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 5b5f006 Jan 30, 2026
13 checks passed
@relud relud deleted the relud-patch-1 branch January 30, 2026 21:10
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.

3 participants