Skip to content

Conversation

@hkad98
Copy link
Contributor

@hkad98 hkad98 commented Jan 30, 2026

ty is a modern replacement of mypy written in Rust. Even though it is still in Beta, it is almost ready for production. Therefore, there is nothing blocking us from giving it a chance.

Before:
Screenshot 2026-01-30 at 13 49 55

After:
Screenshot 2026-01-30 at 13 50 35

JIRA: TRIVIAL
risk: low

[ty](https://docs.astral.sh/ty/) is a modern replacement of mypy written in Rust. Even though it is still in Beta, it is almost ready for production. Therefore, there is nothing blocking us from giving it a chance.

JIRA: TRIVIAL
risk: low
with open(local_target_path, "wb") as download_file:
download_file.write(blob_client.download_blob().readall())
blob_data = blob_client.download_blob().readall()
if isinstance(blob_data, bytes):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we fail explicitly if this does not hold? Or would assert isinstance(blob_data, bytes) be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@janmatzek wdyt? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The condition might not be necessary. IDE shows that blob_data is a bytes object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to assert. Let's wait for @benkeanna to confirm the behaviour.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the readall should return bytes, but ty needs the isinstance or assert to be happy. @benkeanna do you have a preference here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would trust the Azure lib to return bytes and do a cast as @janmatzek suggests to satisfy the type checker

Copy link
Contributor Author

@hkad98 hkad98 Feb 2, 2026

Choose a reason for hiding this comment

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

I changed it to cast(bytes,...), but IDEA complains that the cast is not necessary. Are we okay with that? ;) Maybe it will get better when ty is GA.

Screenshot 2026-02-02 at 11 08 58

Copy link
Contributor

Choose a reason for hiding this comment

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

I would be for now :)
Or we can do this

def read_blob_bytes(client: BlobClient) -> bytes:
    return client.download_blob().readall()

No cast, and the helper has an explicit return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, let's keep the cast and change it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I enabled auto-merge.

JIRA: TRIVIAL
risk: low
@hkad98 hkad98 merged commit e9f31a9 into gooddata:master Feb 2, 2026
9 checks passed
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.

4 participants