Skip to content

Commit ee77eb2

Browse files
Merge branch 'master' into python-selenium
2 parents 37a10cf + bcb9fbd commit ee77eb2

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

duckdb/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
These files will allow you to work along with the [Introducing DuckDB](https://realpython.com/introducing-duckdb/) tutorial.
1+
These files will allow you to work along with the [Introducing DuckDB](https://realpython.com/python-duckdb/) tutorial.
22

33
The files are:
44

5-
Code Download.ipynb - Contains the code you see in the tutorial.
6-
parties.json - JSON file containing political party information.
7-
presidents.csv - CSV file containing president information.
8-
presidents.parquet - Parquet file containing president information.
5+
- `duckdb_code.ipynb`: Contains the code you see in the tutorial.
6+
- `parties.json`: JSON file containing political party information.
7+
- `presidents.csv`: CSV file containing president information.
8+
- `presidents.parquet`: Parquet file containing president information.
99

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@
8888
"source": [
8989
"**This code won't work.**\n",
9090
"\n",
91+
"```python\n",
9192
"with duckdb.connect(database=\"presidents.db\") as conn:\n",
92-
" conn.sql(\"SELECT * FROM presidents_relation\")\n"
93+
" conn.sql(\"SELECT * FROM presidents_relation\")\n",
94+
"```"
9395
]
9496
},
9597
{
@@ -343,10 +345,10 @@
343345
" print(\n",
344346
" conn.sql(\n",
345347
" \"\"\"\n",
346-
" SELECT last_name, first_name\n",
347-
" FROM presidents\n",
348-
" WHERE sequence = 1\n",
349-
" \"\"\"\n",
348+
" SELECT last_name, first_name\n",
349+
" FROM presidents\n",
350+
" WHERE sequence = 1\n",
351+
" \"\"\"\n",
350352
" )\n",
351353
" )"
352354
]
@@ -391,7 +393,9 @@
391393
"source": [
392394
"**Only run this code if you need to update your existing `short_name()` function**\n",
393395
"\n",
394-
"duckdb.remove_function(\"short_name\")"
396+
"```python\n",
397+
"duckdb.remove_function(\"short_name\")\n",
398+
"```"
395399
]
396400
},
397401
{
@@ -450,15 +454,15 @@
450454
"import duckdb\n",
451455
"\n",
452456
"with duckdb.connect(\"presidents.db\") as conn:\n",
453-
" pandas_df = conn.sql(\n",
457+
" pandas_presidents = conn.sql(\n",
454458
" \"\"\"\n",
455459
" SELECT last_name, first_name\n",
456460
" FROM presidents\n",
457461
" WHERE sequence BETWEEN 2 AND 5\n",
458462
" \"\"\"\n",
459463
" ).df()\n",
460464
"\n",
461-
"pandas_df"
465+
"pandas_presidents"
462466
]
463467
},
464468
{

python-code-quality/functionality.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# return a + b
33

44

5-
def add_numbers(a: int | float, b: int | float) -> int | float:
5+
def add_numbers(a: int | float, b: int | float) -> float:
66
a, b = float(a), float(b)
77
return a + b
88

python-code-quality/testability.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# import pytest
22

33
# def greet(name):
4-
# print(f"Hello, {name}")
4+
# print(f"Hello, {name}!")
55

66

77
# def test_greet(capsys):
88
# greet("Alice")
99
# captured = capsys.readouterr()
10-
# assert captured.out.strip() == "Hello, Alice"
10+
# assert captured.out.strip() == "Hello, Alice!"
1111

1212

1313
def greet(name: str) -> str:
14-
return f"Hello, {name}"
14+
return f"Hello, {name}!"
1515

1616

1717
# Easy to test
1818
def test_greet():
19-
assert greet("Alice") == "Hello, Alice"
19+
assert greet("Alice") == "Hello, Alice!"

0 commit comments

Comments
 (0)