-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from whylabs/non-secret-config
Add additional columns to upload output, move config to function inputs
- Loading branch information
Showing
20 changed files
with
574 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
dist/ | ||
__pycache__ | ||
*.pyc | ||
*.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
|
||
print(view.to_pandas()) | ||
print(view._metadata) | ||
print(view.dataset_timestamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from whylogs.core.dataset_profile import DatasetProfileView | ||
import base64 | ||
import sys | ||
|
||
filepath = sys.argv[1] | ||
|
||
# Read ./profile.base64 | ||
profile = open(filepath, "rb").read() | ||
view = DatasetProfileView.deserialize(profile) | ||
|
||
print(view.to_pandas()) | ||
print(view._metadata) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import ast | ||
import astunparse | ||
import sys | ||
|
||
def remove_relative_imports(filename) -> None: | ||
# Read the source file. | ||
with open(filename, "r") as source: | ||
tree = ast.parse(source.read(), filename) | ||
|
||
# Function to check if the current node is a relative import. | ||
def is_relative_import(node) -> bool: | ||
return isinstance(node, ast.ImportFrom) and node.level != 0 | ||
|
||
def is_comment(node) -> bool: | ||
return isinstance(node, ast.Expr) and isinstance(node.value, ast.Str) | ||
|
||
# Remove the relative import statement nodes. | ||
new_tree_body = [node for node in tree.body if not is_relative_import(node) and not is_comment(node)] | ||
tree.body = new_tree_body | ||
|
||
# Write the modified tree back to the source file. | ||
with open(filename, "w") as source: | ||
source.write(astunparse.unparse(tree)) | ||
|
||
def main() -> None: | ||
# Check if the script received the right number of arguments. | ||
if len(sys.argv) != 2: | ||
print(f"Usage: {sys.argv[0]} filename") | ||
sys.exit(1) | ||
|
||
# The list of command line arguments passed to a Python script. argv[0] is the script name. | ||
file_path = sys.argv[1] | ||
|
||
try: | ||
remove_relative_imports(file_path) | ||
print(f"Removed all relative imports from '{file_path}'.") | ||
except Exception as e: | ||
print(f"An error occurred: {e}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.