Skip to main content

Guides

API

Data integrations

Streaming pipelines

IO classes

Style guide

Linter

Install flake8 in your IDE to lint the Python code. To run the linter locally, execute this script:

Testing

Unit tests

Add unit tests for the feature in mage_ai/tests directory. To run the tests locally, execute this script:
It is also possible to run unit tests directly in a live docker instance, as given in the following steps.
  1. Find out the backend server container name, with the command docker container ls in a terminal:
  1. Start an interactive bash session with the backend server container:
  1. Run unit tests with the following command:

Debugging

Instead of using breakpoint(), add the following line to your code where you want a debug:
Attach to running container to use debugger. To get the container ID, run docker ps and look in the NAMES column.

Snippets