Skip to content

Commit

Permalink
changing hey to help
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Feb 2, 2024
1 parent 1def0a2 commit 8e5c25e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def create_sageworks_api_policy(self) -> iam.ManagedPolicy:
"athena:GetQueryResults", # To fetch query results
"athena:StopQueryExecution", # To stop query executions, if needed
"athena:GetWorkGroup", # To get workgroup details
"athena:ListWorkGroups" # To list available workgroups
"athena:ListWorkGroups", # To list available workgroups
],
resources=["*"],
),
Expand Down
23 changes: 17 additions & 6 deletions src/sageworks/repl/sageworks_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self):
self.shell = InteractiveShellEmbed(config=config, banner1="", exit_msg="Goodbye from SageWorks!")

# Register our custom commands
self.commands["hey"] = self.hey
self.commands["help"] = self.help
self.commands["docs"] = self.doc_browser
self.commands["summary"] = self.summary
self.commands["incoming_data"] = self.incoming_data
Expand All @@ -105,7 +105,7 @@ def start(self):
cprint("red", f"Path: {self.cm.site_config_path}")
self.show_config()
else:
self.hey()
self.help()
self.summary()

# Start the REPL
Expand Down Expand Up @@ -204,10 +204,24 @@ def import_sageworks(self):
self.commands["pd"] = importlib.import_module("pandas")
self.commands["pprint"] = importlib.import_module("pprint").pprint

def help(self, *args):
"""Custom help command for the SageWorks REPL
Args:
*args: Arguments passed to the help command.
"""
# If we have args forward to the built-in help function
if args:
help(*args)

# Otherwise show the SageWorks help message
else:
cprint("lightblue", self.help_txt())

@staticmethod
def help_txt():
help_msg = """ Commands:
- hey: Show this help message
- help: Show this help message
- docs: Open browser to show SageWorks Documentation
- summary: Show a summary of all the AWS Artifacts
- incoming_data: List all the incoming S3 data
Expand All @@ -222,9 +236,6 @@ def help_txt():
- exit: Exit SageWorks REPL"""
return help_msg

def hey(self):
cprint("lightblue", self.help_txt())

@staticmethod
def doc_browser():
"""Open a browser and start the Dash app and open a browser."""
Expand Down
1 change: 1 addition & 0 deletions src/sageworks/utils/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def _load_default_config(self) -> Dict[str, Any]:
# Simulate running on Docker
def running_on_docker() -> bool: # noqa: F811
return True

ConfigManager._instance = None # We need to reset the singleton instance for testing
os.environ.pop("SAGEWORKS_BUCKET", None)
cm = ConfigManager()
Expand Down

0 comments on commit 8e5c25e

Please sign in to comment.