from pyspark.sql import SparkSession
def entrypoint():
spark = SparkSession.builder.getOrCreate()
spark.table("this table doesn't exist")
if __name__ == "__main__":
entrypoint()
setup.py file:
"""
This file configures the Python package with entrypoints used for future runs on Databricks.
Please follow the `entry_points` documentation for more details on how to configure the entrypoint:
* https://setuptools.pypa.io/en/latest/userguide/entry_point.html
"""
from setuptools import find_packages, setup
from cicd_sample_project import __version__
PACKAGE_REQUIREMENTS = ["pyyaml"]
# packages for local development and unit testing
# please note that these packages are already available in DBR, there is no need to install them on DBR.
LOCAL_REQUIREMENTS = [
"pyspark==3.2.1",
"delta-spark==1.1.0",
]
TEST_REQUIREMENTS = [
# development & testing tools
"dbx>=0.8,<0.9"
]
setup(
name="cicd_sample_project",
packages=find_packages(exclude=["tests", "tests.*"]),
setup_requires=["setuptools","wheel"],
install_requires=PACKAGE_REQUIREMENTS,
extras_require={"local": LOCAL_REQUIREMENTS, "test": TEST_REQUIREMENTS},
entry_points = {
"console_scripts": [
]},
version=__version__,
description="",
author="",
)
Expected Behavior
When looking at the Databricsk UI the error message with the stack trace is displayed in a clear way.
Current Behavior
When running the job on the Databricks 11.3 LTS Runtime the error message in the UI contains ANSI escape characters:
Steps to Reproduce (for bugs)
dbx deploy
command.Context
I've noticed that there is a problem when showing the error message in Databricks Runtime 11.3 LTS. In order to verify this here is an example setup:
Parts of the deployment file:
Content of the
cicd_sample_project/main.py
file:setup.py
file:Your Environment
dbx version used:
Databricks Runtime version:
python venv:
Local OS info:
MacOS 12.6.1 (21G217)