예제 #1
0
    get_component_run_information,
    get_components_with_tag,
    get_history,
    web_trace,
    get_recent_run_ids,
    get_io_pointer,
    set_db_uri,
)

import copy
import json
import logging

app = Flask(__name__, static_folder="ui/build", static_url_path="")
api = Blueprint("api", __name__)
set_db_uri("postgresql://*****:*****@database:5432/sqlalchemy")


def error(err_msg, status_code):
    return Response(json.dumps({"error": err_msg}), status=status_code)


def serialize_component_run(c: Component, cr: ComponentRun) -> str:
    """Serializes component run to display info on a card."""
    web_cr_dict = json.loads(str(cr))

    # Add component information
    web_cr_dict["owner"] = c.owner
    web_cr_dict["description"] = c.description
    web_cr_dict["tags"] = c.tags
예제 #2
0
 def setUp(self):
     set_db_uri("test")