Skip to content

Commit 52a1ab9

Browse files
author
acirtep
committed
fix: add param details to Python rel API definition
1 parent a2d2e5f commit 52a1ab9

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

β€Ždocs/preview/clients/python/relational_api.mdβ€Ž

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,15 @@ query(self: duckdb.duckdb.DuckDBPyRelation, virtual_table_name: str, sql_query:
941941

942942
Run the given SQL query in sql_query on the view named virtual_table_name that refers to the relation object
943943

944+
##### Parameters
945+
946+
- **virtual_table_name** : str
947+
948+
The name to assign to the current relation when referenced in the SQL query.
949+
- **sql_query** : str
950+
951+
The SQL query string that uses the virtual table name to query the relation.
952+
944953
##### Example
945954

946955
```python
@@ -992,6 +1001,12 @@ set_alias(self: duckdb.duckdb.DuckDBPyRelation, alias: str) -> duckdb.duckdb.Duc
9921001

9931002
Rename the relation object to new alias
9941003

1004+
##### Parameters
1005+
1006+
- **alias** : str
1007+
1008+
The alias name to assign to the relation.
1009+
9951010
##### Example
9961011

9971012
```python
@@ -1068,6 +1083,24 @@ show(self: duckdb.duckdb.DuckDBPyRelation, *, max_width: typing.Optional[int] =
10681083

10691084
Display a summary of the data
10701085

1086+
##### Parameters
1087+
1088+
- **max_width** : int
1089+
1090+
Maximum display width for the entire output in characters.
1091+
- **max_rows** : int
1092+
1093+
Maximum number of rows to display.
1094+
- **max_col_width** : int
1095+
1096+
Maximum number of characters to display per column.
1097+
- **null_value** : str
1098+
1099+
String to display in place of NULL values.
1100+
- **render_mode** : object
1101+
1102+
Render mode for displaying the output.
1103+
10711104
##### Example
10721105

10731106
```python

β€Žscripts/generate_python_relational_docs_details.pyβ€Ž

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,29 @@ class PythonRelAPIDetails:
447447
β”‚ created_timestamp β”‚ TIMESTAMP WITH TIME ZONE β”‚ YES β”‚ NULL β”‚ NULL β”‚ NULL β”‚
448448
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
449449
""",
450+
parameters=[
451+
PythonRelAPIParamDetails(
452+
parameter_name="virtual_table_name",
453+
parameter_type=["str"],
454+
parameter_description="The name to assign to the current relation when referenced in the SQL query.",
455+
),
456+
PythonRelAPIParamDetails(
457+
parameter_name="sql_query",
458+
parameter_type=["str"],
459+
parameter_description="The SQL query string that uses the virtual table name to query the relation.",
460+
),
461+
],
450462
),
451463
'set_alias': PythonRelAPIDetails(
452464
example="rel.set_alias('abc').select('abc.id')",
453465
result='In the SQL query, the alias will be `abc`',
466+
parameters=[
467+
PythonRelAPIParamDetails(
468+
parameter_name="alias",
469+
parameter_type=["str"],
470+
parameter_description="The alias name to assign to the relation.",
471+
)
472+
],
454473
),
455474
'alias': PythonRelAPIDetails(
456475
example='rel.alias', result='unnamed_relation_43c808c247431be5'
@@ -474,6 +493,33 @@ class PythonRelAPIDetails:
474493
β”‚ 08fdcbf8-4e53-4290-9e81-423af263b518 β”‚ value is uneven β”‚ 9 β”‚ 2025-04-09 15:49:20.642+02 β”‚
475494
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
476495
""",
496+
parameters=[
497+
PythonRelAPIParamDetails(
498+
parameter_name="max_width",
499+
parameter_type=["int"],
500+
parameter_description="Maximum display width for the entire output in characters.",
501+
),
502+
PythonRelAPIParamDetails(
503+
parameter_name="max_rows",
504+
parameter_type=["int"],
505+
parameter_description="Maximum number of rows to display.",
506+
),
507+
PythonRelAPIParamDetails(
508+
parameter_name="max_col_width",
509+
parameter_type=["int"],
510+
parameter_description="Maximum number of characters to display per column.",
511+
),
512+
PythonRelAPIParamDetails(
513+
parameter_name="null_value",
514+
parameter_type=["str"],
515+
parameter_description="String to display in place of NULL values.",
516+
),
517+
PythonRelAPIParamDetails(
518+
parameter_name="render_mode",
519+
parameter_type=["object"],
520+
parameter_description="Render mode for displaying the output.",
521+
),
522+
],
477523
),
478524
'sql_query': PythonRelAPIDetails(
479525
example='rel.sql_query()',

0 commit comments

Comments
Β (0)