Skip to content

Conversation

ankit-amazon
Copy link
Contributor

Description of changes:

  • Rules Added: python/notebook-best-practice-violation@v1.0
  • Added compliant and non compliant examples

@@ -0,0 +1,18 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Choose a reason for hiding this comment

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

This rule detects three kinds of violations: empty cell, too many cel, as well as misplaced imports. You need to add them.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improved examples.

Comment on lines 4 to 5
def __CELL_EDGE__(x):
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the CELL_EDGE markers

@@ -0,0 +1,20 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need separate files for compliant and non compliant? Can these be in the same .py file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to cover all three types of violation(blank cell, cell limit, misplaced imports) in one file is not possible. Is it ok if we create separate files for each example?

Copy link
Contributor

@san2488 san2488 left a comment

Choose a reason for hiding this comment

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

I'm not sure this will pass through the Detector Library publish correctly due to being in 2 separate files and failing linter checks. Not approving this one yet.

Copy link
Contributor

@san2488 san2488 left a comment

Choose a reason for hiding this comment

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

Let's discuss what we want here. In the current state, we can't publish this since the library only supports .py files.

# SPDX-License-Identifier: Apache-2.0

# {fact rule=notebook-best-practice-violation@v1.0 defects=1}
# —— Code Cell 1, Execution Count 1 —— #

Choose a reason for hiding this comment

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

In this example, remove all Execution Count, as this information is not needed
Write this.
# —— Code Cell 1—— #

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

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