Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ensure accessor typing does not make static type checker error #785

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

z3z1ma
Copy link
Collaborator

@z3z1ma z3z1ma commented Nov 23, 2023

Another quick patch for one of the more common public APIs.

Anywhere you use dlt.config.value or dlt.secrets.value will throw an error with Pyright (possibly other checkers depending on settings but pyright is the defacto standard in vscode for example which a large number of users use) unless the value is marked optional. This is antithetical to the point of the sentinel value as its presence indicates that a value will in fact contain something.

So we should use Any here. Using Any fixes the below errors.

image image

Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit 7f3c4c6
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/655ec689149d590008f2b353
😎 Deploy Preview https://deploy-preview-785--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@z3z1ma z3z1ma requested a review from rudolfix November 23, 2023 03:27
Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

huh! it should be Any form the very start. thx!

@rudolfix rudolfix merged commit e48813f into devel Nov 23, 2023
41 of 43 checks passed
@rudolfix rudolfix deleted the fix/correct-typing-for-dlt-config branch November 23, 2023 17:02
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