Skip to content

Commit 451a58c

Browse files
committed
make lint
1 parent d69f359 commit 451a58c

1 file changed

Lines changed: 20 additions & 25 deletions

File tree

notebooks/pyiceberg_example.ipynb

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"outputs": [],
99
"source": [
1010
"# Import required libraries\n",
11+
"import pyarrow as pa\n",
12+
"\n",
1113
"import pyiceberg\n",
1214
"from pyiceberg.catalog import load_catalog\n",
13-
"from pyiceberg.table import Table\n",
14-
"import pandas as pd\n",
15-
"import pyarrow as pa\n",
15+
"\n",
1616
"print(f\"PyIceberg version: {pyiceberg.__version__}\")"
1717
]
1818
},
@@ -34,11 +34,10 @@
3434
"outputs": [],
3535
"source": [
3636
"# Import required libraries\n",
37-
"from pyiceberg.catalog import load_catalog\n",
38-
"import pyarrow.parquet as pq\n",
39-
"import pyarrow.compute as pc\n",
37+
"import os\n",
4038
"import tempfile\n",
41-
"import os"
39+
"\n",
40+
"import pyarrow.compute as pc"
4241
]
4342
},
4443
{
@@ -63,11 +62,9 @@
6362
"# Configure and load the catalog\n",
6463
"catalog = load_catalog(\n",
6564
" \"default\",\n",
66-
" **{\n",
67-
" 'type': 'sql',\n",
68-
" \"uri\": f\"sqlite:///{warehouse_path}/pyiceberg_catalog.db\",\n",
69-
" \"warehouse\": f\"file://{warehouse_path}\",\n",
70-
" },\n",
65+
" type=\"sql\",\n",
66+
" uri=f\"sqlite:///{warehouse_path}/pyiceberg_catalog.db\",\n",
67+
" warehouse=f\"file://{warehouse_path}\",\n",
7168
")\n",
7269
"\n",
7370
"print(\"Catalog loaded successfully!\")\n",
@@ -114,15 +111,14 @@
114111
"outputs": [],
115112
"source": [
116113
"# Create sample data using PyArrow\n",
117-
"import pyarrow as pa\n",
118114
"\n",
119115
"# Sample taxi-like data\n",
120116
"data = {\n",
121-
" 'vendor_id': [1, 2, 1, 2, 1],\n",
122-
" 'trip_distance': [1.5, 2.3, 0.8, 5.2, 3.1],\n",
123-
" 'fare_amount': [10.0, 15.5, 6.0, 22.0, 18.0],\n",
124-
" 'tip_amount': [2.0, 3.0, 1.0, 4.5, 3.5],\n",
125-
" 'passenger_count': [1, 2, 1, 3, 2]\n",
117+
" \"vendor_id\": [1, 2, 1, 2, 1],\n",
118+
" \"trip_distance\": [1.5, 2.3, 0.8, 5.2, 3.1],\n",
119+
" \"fare_amount\": [10.0, 15.5, 6.0, 22.0, 18.0],\n",
120+
" \"tip_amount\": [2.0, 3.0, 1.0, 4.5, 3.5],\n",
121+
" \"passenger_count\": [1, 2, 1, 3, 2],\n",
126122
"}\n",
127123
"\n",
128124
"df = pa.table(data)\n",
@@ -313,14 +309,13 @@
313309
"outputs": [],
314310
"source": [
315311
"# List all files in the warehouse\n",
316-
"import os\n",
317-
"for root, dirs, files in os.walk(warehouse_path):\n",
318-
" level = root.replace(warehouse_path, '').count(os.sep)\n",
319-
" indent = ' ' * 2 * level\n",
320-
" print(f'{indent}{os.path.basename(root)}/')\n",
321-
" subindent = ' ' * 2 * (level + 1)\n",
312+
"for root, _dirs, files in os.walk(warehouse_path):\n",
313+
" level = root.replace(warehouse_path, \"\").count(os.sep)\n",
314+
" indent = \" \" * 2 * level\n",
315+
" print(f\"{indent}{os.path.basename(root)}/\")\n",
316+
" subindent = \" \" * 2 * (level + 1)\n",
322317
" for file in files:\n",
323-
" print(f'{subindent}{file}')"
318+
" print(f\"{subindent}{file}\")"
324319
]
325320
},
326321
{

0 commit comments

Comments
 (0)