Tool to run Ubuntu VM's easily with command-line interface.
List available instances
multipass list
Create and launch a new instance using the latest LTS release
| # Upsert function for pandas to_sql with postgres | |
| # https://stackoverflow.com/questions/1109061/insert-on-duplicate-update-in-postgresql/8702291#8702291 | |
| # https://www.postgresql.org/docs/devel/sql-insert.html#SQL-ON-CONFLICT | |
| import pandas as pd | |
| from sqlalchemy import create_engine, text, engine | |
| import uuid | |
| from settings import DB_STR | |
| from sqlalchemy.engine.base import Connection | |
| from sqlalchemy.sql.elements import TextClause |
| import duckdb | |
| from google.cloud import bigquery | |
| bqclient = bigquery.Client() | |
| table = bigquery.TableReference.from_string( | |
| "bigquery-public-data.utility_us.country_code_iso" | |
| ) | |
| rows = bqclient.list_rows(table) | |
| country_code_iso = rows.to_arrow(create_bqstorage_client=True) | |
| cursor = duckdb.connect() |