Source: https://en.wikisource.org/wiki/Universal_Declaration_of_Human_Rights
Universal Declaration of Human Rights the United Nations General Assembly 1948
Exported from Wikisource on December 24, 2024
A UNIVERSAL DECLARATION
#!/usr/bin/env python3 | |
""" | |
Prerequisite: | |
docker run --rm --name=cratedb \ | |
--publish=4200:4200 --publish=5432:5432 \ | |
--env=CRATE_HEAP_SIZE=2g crate/crate:nightly \ | |
-Cdiscovery.type=single-node | |
Variants: |
""" | |
Investigate anomaly with pandas and CrateDB, re. storing `DATE` types that naturally do not use time zones. | |
https://github.com/crate/sqlalchemy-cratedb/issues/216 | |
Setup: Please install dependency packages enumerated below. | |
Usage: Please toggle database connection URI per `dburi = this or that`. | |
Invoke: Just type `uv run pandas_cratedb_date_type.py`. | |
docker run --rm -it --name=cratedb --publish=4200:4200 --publish=5432:5432 --env=CRATE_HEAP_SIZE=2g crate/crate:nightly -Cdiscovery.type=single-node | |
docker run --rm -it --name=postgresql --publish=5433:5432 --env "POSTGRES_HOST_AUTH_METHOD=trust" postgres:17 postgres -c log_statement=all |
#!/usr/bin/env python3 | |
# /// script | |
# requires-python = ">=3.9" | |
# dependencies = [ | |
# "sqlalchemy-cratedb", | |
# ] | |
# /// | |
""" | |
Usage: |
import sqlalchemy as sa | |
TIMEOUT = 0.00001 | |
if __name__ == "__main__": | |
engine = sa.create_engine('crate://localhost/', connect_args={"timeout": TIMEOUT}) | |
c = engine.connect() | |
result = c.execute(sa.text("SELECT 42;")) | |
print(result.all()) |
""" | |
# Transfer GitHub Pull Requests | |
## About | |
Transfer pull requests on GitHub from one repository to another. | |
## Details | |
Here: Transfer PRs closed by stale bot on the PyCaret repository, | |
modulo updates submitted by Dependabot, to the fork at sktime. |
#!/usr/bin/env python | |
""" | |
## About | |
Concisely fetch data from remote resources in Python, with caching. | |
## Synopsis | |
``` | |
uv run acquire_dataset_cached.py | |
``` |
Source: https://en.wikisource.org/wiki/Universal_Declaration_of_Human_Rights
Universal Declaration of Human Rights the United Nations General Assembly 1948
Exported from Wikisource on December 24, 2024
A UNIVERSAL DECLARATION
# GitHub Actions Workflow Failures Digest for CrateDB's ecosystem | |
# https://github.com/crate/crate-clients-tools/issues/148 | |
# Optionally use authentication when running into rate limits. | |
# It is an (here invalidated) personal access token (classic), | |
# using the "workflow" scope. | |
# GITHUB_TOKEN=ghp_00r4G0tGxLDT5RGOwWNw7tZhFnK5fT0uMfoo | |
# HTTPIE_OPTIONS="--auth-type bearer --auth ${GITHUB_TOKEN}" |
# Connect using SQLAlchemy Core. | |
import sqlalchemy as sa | |
from pprint import pp | |
dburi = "crate://localhost:4200" | |
query = "SELECT country, mountain, coordinates, height FROM sys.summits ORDER BY country;" | |
def print_active_servers(connection: sa.engine.Connection): | |
print("Active Servers:", connection.connection.dbapi_connection.client.active_servers) |
""" | |
Attempt to trip a low-memory condition in CrateDB, resulting in a weird error message | |
like `SQLParseException[ShardCollectContext for 0 already added]`. | |
This program tries to emulate the MLflow test case `test_search_runs_returns_expected_results_with_large_experiment`, | |
succeeded by a `DELETE FROM` table truncation operation. | |
Remark: It did not work out well. This program trips `OutOfMemoryError[Java heap space]` | |
right away. Please use the MLflow test case reproducer demonstrated at: | |
https://github.com/crate-workbench/mlflow-cratedb/issues/53#issuecomment-1927234463 |