How to use the doltpy.core.system_helpers.get_logger function in doltpy

To help you get started, we’ve selected a few doltpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dolthub / dolt / benchmark / perf_tools / python / push_output_to_dolthub.py View on Github external
from doltpy.etl import get_df_table_writer, get_dolt_loader, load_to_dolthub
from doltpy.core.system_helpers import get_logger
import pandas as pd
import argparse
import os

RESULTS_TABLE_PKS = ['username', 'timestamp', 'committish', 'test_name']
RESULTS_TABLE = 'sysbench_benchmark'


logger = get_logger(__name__)


def write_results_to_dolt(results_file: str, remote: str, branch: str):
    table_writer = get_df_table_writer(RESULTS_TABLE,
                                       lambda: pd.read_csv(results_file),
                                       RESULTS_TABLE_PKS,
                                       import_mode='update')
    loader = get_dolt_loader(table_writer, True, 'benchmark run', branch)
    load_to_dolthub(loader, clone=True, push=True, remote_name='origin', remote_url=remote)


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--results-file', type=str, required=True)
    parser.add_argument('--remote-results-db', type=str, required=True)
    parser.add_argument('--remote-results-db-branch', type=str, required=False, default='master')

doltpy

A Python package for using Dolt database via Python.

Apache-2.0
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis