Skip to content

tercen/pandasai_operator

Repository files navigation

Template Python Operator

Cell-wise mean calculated implemented in Python.

Python operator - Development workflow

source /config/.pyenv/versions/3.9.0/bin/activate
pip install -r requirements.txt
  • Develop your operator. Note that you can interact with an existing data step by specifying arguments to the TercenContext function:
tercenCtx = ctx.TercenContext()
tercenCtx = ctx.TercenContext(
    workflowId="YOUR_WORKFLOW_ID",
    stepId="YOUR_STEP_ID",
    username="admin", # if using the local Tercen instance
    password="admin", # if using the local Tercen instance
    serviceUri = "http://tercen:5400/" # if using the local Tercen instance 
)
  • Generate requirements
python3 -m tercen.util.requirements . > requirements.txt
  • Push your changes to GitHub: triggers CI GH workflow
  • Tag the repository: triggers Release GH workflow
  • Go to tercen and install your operator

Helpful Commands

Install Tercen Python Client

python3 -m pip install --force git+https://github.com/tercen/[email protected]

Wheel

Though not strictly mandatory, many packages require it.

python3 -m pip install wheel

VSCode Launch

To run and debug the code, VSCode requires a launch.json file, which will be automatically created. If the generated file does not run properly within the virtual environment, use the one below:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "python": "PATH TO VENV PYTHON",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": { "PYTHONPATH": "${workspaceRoot}"}
            
        }
    ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published