bauplan.helpers
The Bauplan module does not come with pandas, but it can be used with pandas workflows if pandas is installed.
This module provides a few utility functions that can be used to run SQL queries against a Bauplan instance, and to visualize the results in a Python notebook through a magic cell syntax.
def bauplan_sql
def bauplan_sqlThis function is a magic cell that allows users to run SQL queries on Bauplan directly in a Python notebook cell - optionally, the branch can be specified next to the magic command, e.g.:
%%bauplan_sql main
SELECT c1 FROM t2 WHERE f=1
The result of the query will be returned as a pandas DataFrame object, which gets nicely visualized in a Python notebook by default.
This function is not intended to be called directly, but rather used as a magic cell.
If you do not have pandas installed, this raises MissingPandasError.
Parameters
def in_notebook
def in_notebookdef magic_cell_import_checker
def magic_cell_import_checkerDecorator replace the proper magic cell import with a dummy function if the magic cell import failed at import time.
Parameters
def pandas_import_checker
def pandas_import_checkerDecorator checks if pandas is installed before running the function.
The user may have already pandas installed, so we don't bundle it with our SDK - however, if they don't have it, we should let them know that conversion to pandas object will not work!
Parameters
def register_cell_magic
def register_cell_magicDecorator replace the proper magic cell import with a dummy function if the magic cell import failed at import time.