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

Lint error on empty field description #555

Open
tomyki opened this issue Dec 16, 2024 · 3 comments
Open

Lint error on empty field description #555

tomyki opened this issue Dec 16, 2024 · 3 comments

Comments

@tomyki
Copy link

tomyki commented Dec 16, 2024

Hello,
When I'm linting my data contract with this chunk of code I'm getting an error in linting

models:
  ABCD:
    description: Data ABCD view
    type: view
    fields:
      ID:
        type: number
        required: true

Error message:
Data contract is invalid, found the following errors:

  1. Linter 'Objects have descriptions': Field 'ID' in model
    'ABCD' has empty description.

It is weird because description in field is said to be optional but it is throwing an error even though it is just warning,

@jon-ruckwood
Copy link

I’ve recently encountered the same issue, where only a passed result leads to a successful outcome. It seems warnings are treated the same as errors, as outlined here:

if run.result == "passed":
console.print(
f"🟢 data contract is valid. Run {len(run.checks)} checks. Took {(run.timestampEnd - run.timestampStart).total_seconds()} seconds."
)
else:
console.print("🔴 data contract is invalid, found the following errors:")

It would be helpful if the CLI handled the "passed with warnings" case more appropriately.

The lint functionality is generating a lot of false positives for us, which adds unnecessary noise.

@jochenchrist
Copy link
Contributor

Could you review, if this PR would resolve your issue: #581

@jon-ruckwood
Copy link

Could you review, if this PR would resolve your issue: #581

Yes, I've tried it and it does solve my issue.

I was thinking about contributing myself, but you guys are quick – thank you!

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

No branches or pull requests

3 participants