diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-12 15:09:30 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-12 15:09:30 -0700 |
commit | ccbf9d5c66d5a255d1cfeaee6b07df92186baa61 (patch) | |
tree | c0ab812d23494d23359abe5319f8a9b60d94e8db /continuedev/src | |
parent | a13cb867ec0ea831d78e6d928463bd256babced5 (diff) | |
parent | 19769044e875295c2e247dfd4c9d91ab1bf5dc28 (diff) | |
download | sncontinue-ccbf9d5c66d5a255d1cfeaee6b07df92186baa61.tar.gz sncontinue-ccbf9d5c66d5a255d1cfeaee6b07df92186baa61.tar.bz2 sncontinue-ccbf9d5c66d5a255d1cfeaee6b07df92186baa61.zip |
Merge branch 'main' into superset-of-chat
Diffstat (limited to 'continuedev/src')
5 files changed, 17 insertions, 20 deletions
diff --git a/continuedev/src/continuedev/core/main.py b/continuedev/src/continuedev/core/main.py index 3053e5a1..81aaaf2e 100644 --- a/continuedev/src/continuedev/core/main.py +++ b/continuedev/src/continuedev/core/main.py @@ -147,7 +147,7 @@ class Step(ContinueBaseModel): if self.description is not None: d["description"] = self.description else: - d["description"] = "`Description loading...`" + d["description"] = "`Step in progress...`" return d @validator("name", pre=True, always=True) diff --git a/continuedev/src/continuedev/recipes/AddTransformRecipe/main.py b/continuedev/src/continuedev/recipes/AddTransformRecipe/main.py index e9a998e3..fdd343f5 100644 --- a/continuedev/src/continuedev/recipes/AddTransformRecipe/main.py +++ b/continuedev/src/continuedev/recipes/AddTransformRecipe/main.py @@ -19,7 +19,7 @@ class AddTransformRecipe(Step): - Run the pipeline and view the transformed data in a Streamlit app"""), name="Add transformation to a dlt pipeline") >> SetUpChessPipelineStep() >> WaitForUserInputStep( - prompt="How do you want to transform the Chess.com API data before loading it? For example, you could use the `python-chess` library to decode the moves or filter out certain games") + prompt="How do you want to transform the Chess.com API data before loading it? For example, you could filter out games that ended in a draw.") ) await sdk.run_step( AddTransformStep( diff --git a/continuedev/src/continuedev/recipes/AddTransformRecipe/steps.py b/continuedev/src/continuedev/recipes/AddTransformRecipe/steps.py index 7bb0fc23..f042424c 100644 --- a/continuedev/src/continuedev/recipes/AddTransformRecipe/steps.py +++ b/continuedev/src/continuedev/recipes/AddTransformRecipe/steps.py @@ -31,12 +31,11 @@ class SetUpChessPipelineStep(Step): 'pip install -r requirements.txt', 'pip install pandas streamlit' # Needed for the pipeline show step later ], name="Set up Python environment", description=dedent(f"""\ - Running the following commands: - - `python3 -m venv env`: Create a Python virtual environment - - `source env/bin/activate`: Activate the virtual environment - - `pip install dlt`: Install dlt - - `dlt init chess duckdb`: Create a new dlt pipeline called "chess" that loads data into a local DuckDB instance - - `pip install -r requirements.txt`: Install the Python dependencies for the pipeline""")) + - Create a Python virtual environment: `python3 -m venv env` + - Activate the virtual environment: `source env/bin/activate` + - Install dlt: `pip install dlt` + - Create a new dlt pipeline called "chess" that loads data into a local DuckDB instance: `dlt init chess duckdb` + - Install the Python dependencies for the pipeline: `pip install -r requirements.txt`""")) class AddTransformStep(Step): @@ -58,10 +57,6 @@ class AddTransformStep(Step): # Open the file and highlight the function to be edited await sdk.ide.setFileOpen(abs_filepath) - await sdk.ide.highlightCode(range_in_file=RangeInFile( - filepath=abs_filepath, - range=Range.from_shorthand(47, 0, 51, 0) - )) with open(os.path.join(os.path.dirname(__file__), 'dlt_transform_docs.md')) as f: dlt_transform_docs = f.read() diff --git a/continuedev/src/continuedev/recipes/DeployPipelineAirflowRecipe/steps.py b/continuedev/src/continuedev/recipes/DeployPipelineAirflowRecipe/steps.py index 4a128786..500a89ba 100644 --- a/continuedev/src/continuedev/recipes/DeployPipelineAirflowRecipe/steps.py +++ b/continuedev/src/continuedev/recipes/DeployPipelineAirflowRecipe/steps.py @@ -71,19 +71,21 @@ class DeployAirflowStep(Step): # Modify the DAG file directory = await sdk.ide.getWorkspaceDirectory() - filepath = os.path.join( - directory, f"dags/dag_{self.source_name}_pipeline.py") + pipeline_filepath = os.path.join( + directory, f"{self.source_name}_pipeline.py") + dag_filepath = os.path.join( + directory, f"dags/dag_{self.source_name}.py") # Replace the pipeline name and dataset name - await sdk.run_step(FindAndReplaceStep(filepath=filepath, pattern="'pipeline_name'", replacement=f"'{self.source_name}_pipeline'")) - await sdk.run_step(FindAndReplaceStep(filepath=filepath, pattern="'dataset_name'", replacement=f"'{self.source_name}_data'")) - await sdk.run_step(FindAndReplaceStep(filepath=filepath, pattern="pipeline_or_source_script", replacement=f"{self.source_name}_pipeline")) + await sdk.run_step(FindAndReplaceStep(filepath=pipeline_filepath, pattern="'pipeline_name'", replacement=f"'{self.source_name}_pipeline'")) + await sdk.run_step(FindAndReplaceStep(filepath=pipeline_filepath, pattern="'dataset_name'", replacement=f"'{self.source_name}_data'")) + await sdk.run_step(FindAndReplaceStep(filepath=pipeline_filepath, pattern="pipeline_or_source_script", replacement=f"{self.source_name}_pipeline")) # Prompt the user for the DAG schedule edit_dag_range = Range.from_shorthand(18, 0, 23, 0) - await sdk.ide.highlightCode(range_in_file=RangeInFile(filepath=filepath, range=edit_dag_range), color="#33993333") + await sdk.ide.highlightCode(range_in_file=RangeInFile(filepath=dag_filepath, range=edit_dag_range), color="#33993333") response = await sdk.run_step(WaitForUserInputStep(prompt="When would you like this Airflow DAG to run? (e.g. every day, every Monday, every 1st of the month, etc.)")) - await sdk.edit_file(filepath, prompt=f"Edit the DAG so that it runs at the following schedule: '{response.text}'", + await sdk.edit_file(dag_filepath, prompt=f"Edit the DAG so that it runs at the following schedule: '{response.text}'", range=edit_dag_range) # Tell the user to check the schedule and fill in owner, email, other default_args diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index dacf0e7b..8dc2478b 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -90,7 +90,7 @@ class ShellCommandsStep(Step): This is a brief summary of the error followed by a suggestion on how it can be fixed:"""), with_history=await sdk.get_chat_context()) sdk.raise_exception( - title="Error while running query", message=output, with_step=MessageStep(name=f"Suggestion to solve error {AI_ASSISTED_STRING}", message=suggestion) + title="Error while running query", message=output, with_step=MessageStep(name=f"Suggestion to solve error {AI_ASSISTED_STRING}", message=f"{suggestion}\n\nYou can click the retry button on the failed step to try again.") ) return TextObservation(text=output) |