Skip to content

Commit 7ec4148

Browse files
committed
Update documentation to cross reference
1 parent 0c75e20 commit 7ec4148

19 files changed

+65
-58
lines changed

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4747
# ones.
4848
extensions = [
49-
"sphinx.ext.autodoc",
50-
"sphinx.ext.autosummary",
49+
# "sphinx.ext.autodoc",
50+
# "sphinx.ext.autosummary",
5151
"sphinx.ext.doctest",
5252
"sphinx.ext.ifconfig",
5353
"sphinx.ext.mathjax",

docs/source/user-guide/basics.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The first statement group:
5454
# create a context
5555
ctx = datafusion.SessionContext()
5656
57-
creates a :code:`SessionContext`, that is, the main interface for executing queries with DataFusion. It maintains the state
57+
creates a :py:class:`~datafusion.context.SessionContext`, that is, the main interface for executing queries with DataFusion. It maintains the state
5858
of the connection between a user and an instance of the DataFusion engine. Additionally it provides the following functionality:
5959

6060
- Create a DataFrame from a CSV or Parquet data source.
@@ -74,9 +74,9 @@ The second statement group creates a :code:`DataFrame`,
7474
df = ctx.create_dataframe([[batch]])
7575
7676
A DataFrame refers to a (logical) set of rows that share the same column names, similar to a `Pandas DataFrame <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html>`_.
77-
DataFrames are typically created by calling a method on :code:`SessionContext`, such as :code:`read_csv`, and can then be modified by
78-
calling the transformation methods, such as :meth:`.DataFrame.filter`, :meth:`.DataFrame.select`, :meth:`.DataFrame.aggregate`,
79-
and :meth:`.DataFrame.limit` to build up a query definition.
77+
DataFrames are typically created by calling a method on :py:class:`~datafusion.context.SessionContext`, such as :code:`read_csv`, and can then be modified by
78+
calling the transformation methods, such as :py:func:`~datafusion.dataframe.DataFrame.filter`, :py:func:`~datafusion.dataframe.DataFrame.select`, :py:func:`~datafusion.dataframe.DataFrame.aggregate`,
79+
and :py:func:`~datafusion.dataframe.DataFrame.limit` to build up a query definition.
8080

8181
The third statement uses :code:`Expressions` to build up a query definition.
8282

@@ -87,5 +87,5 @@ The third statement uses :code:`Expressions` to build up a query definition.
8787
col("a") - col("b"),
8888
)
8989
90-
Finally the :code:`collect` method converts the logical plan represented by the DataFrame into a physical plan and execute it,
91-
collecting all results into a list of `RecordBatch <https://arrow.apache.org/docs/python/generated/pyarrow.RecordBatch.html>`_.
90+
Finally the :py:func:`~datafusion.dataframe.DataFrame.collect` method converts the logical plan represented by the DataFrame into a physical plan and execute it,
91+
collecting all results into a list of `RecordBatch <https://arrow.apache.org/docs/python/generated/pyarrow.RecordBatch.html>`_.

docs/source/user-guide/common-operations/aggregations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Aggregation
1919
============
2020

2121
An aggregate or aggregation is a function where the values of multiple rows are processed together to form a single summary value.
22-
For performing an aggregation, DataFusion provides the :meth:`.DataFrame.aggregate`
22+
For performing an aggregation, DataFusion provides the :py:func:`~datafusion.dataframe.DataFrame.aggregate`
2323

2424
.. ipython:: python
2525

docs/source/user-guide/common-operations/basic-info.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ In this section, you will learn how to display essential details of DataFrames u
3434
})
3535
df
3636
37-
Use :meth:`.DataFrame.limit` to view the top rows of the frame:
37+
Use :py:func:`~datafusion.dataframe.DataFrame.limit` to view the top rows of the frame:
3838

3939
.. ipython:: python
4040
4141
df.limit(2)
4242
43-
Display the columns of the DataFrame using :meth:`.DataFrame.schema`:
43+
Display the columns of the DataFrame using :py:func:`~datafusion.dataframe.DataFrame.schema`:
4444

4545
.. ipython:: python
4646
4747
df.schema()
4848
49-
The method :meth:`.DataFrame.to_pandas` uses pyarrow to convert to pandas DataFrame, by collecting the batches,
49+
The method :py:func:`~datafusion.dataframe.DataFrame.to_pandas` uses pyarrow to convert to pandas DataFrame, by collecting the batches,
5050
passing them to an Arrow table, and then converting them to a pandas DataFrame.
5151

5252
.. ipython:: python
5353
5454
df.to_pandas()
5555
56-
:meth:`.DataFrame.describe` shows a quick statistic summary of your data:
56+
:py:func:`~datafusion.dataframe.DataFrame.describe` shows a quick statistic summary of your data:
5757

5858
.. ipython:: python
5959

docs/source/user-guide/common-operations/expressions.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ concept shared across most compilers and databases.
2828
Column
2929
------
3030

31-
The first expression most new users will interact with is the Column, which is created by calling :func:`col`.
32-
This expression represents a column within a DataFrame. The function :func:`col` takes as in input a string
31+
The first expression most new users will interact with is the Column, which is created by calling :py:func:`~datafusion.col`.
32+
This expression represents a column within a DataFrame. The function :py:func:`~datafusion.col` takes as in input a string
3333
and returns an expression as it's output.
3434

3535
Literal
3636
-------
3737

3838
Literal expressions represent a single value. These are helpful in a wide range of operations where
39-
a specific, known value is of interest. You can create a literal expression using the function :func:`lit`.
40-
The type of the object passed to the :func:`lit` function will be used to convert it to a known data type.
39+
a specific, known value is of interest. You can create a literal expression using the function :py:func:`~datafusion.lit`.
40+
The type of the object passed to the :py:func:`~datafusion.lit` function will be used to convert it to a known data type.
4141

4242
In the following example we create expressions for the column named `color` and the literal scalar string `red`.
4343
The resultant variable `red_units` is itself also an expression.
@@ -64,7 +64,7 @@ Functions
6464
---------
6565

6666
As mentioned before, most functions in DataFusion return an expression at their output. This allows us to create
67-
a wide variety of expressions built up from other expressions. For example, :func:`.alias` is a function that takes
67+
a wide variety of expressions built up from other expressions. For example, :py:func:`~datafusion.expr.Expr.alias` is a function that takes
6868
as it input a single expression and returns an expression in which the name of the expression has changed.
6969

7070
The following example shows a series of expressions that are built up from functions operating on expressions.

docs/source/user-guide/common-operations/functions.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ We'll use the pokemon dataset in the following examples.
4040
Mathematical
4141
------------
4242

43-
DataFusion offers mathematical functions such as :func:`.pow` or :func:`.log`
43+
DataFusion offers mathematical functions such as :py:func:`~datafusion.functions.pow` or :py:func:`~datafusion.functions.log`
4444

4545
.. ipython:: python
4646
@@ -55,7 +55,7 @@ DataFusion offers mathematical functions such as :func:`.pow` or :func:`.log`
5555
Conditional
5656
-----------
5757

58-
There 3 conditional functions in DataFusion :func:`.coalesce`, :func:`.nullif` and :func:`.case` (not available in Python)
58+
There 3 conditional functions in DataFusion :py:func:`~datafusion.functions.coalesce`, :py:func:`~datafusion.functions.nullif` and :py:func:`~datafusion.functions.case`.
5959

6060
.. ipython:: python
6161
@@ -66,13 +66,13 @@ There 3 conditional functions in DataFusion :func:`.coalesce`, :func:`.nullif` a
6666
Temporal
6767
--------
6868

69-
For selecting the current time use :func:`.now`
69+
For selecting the current time use :py:func:`~datafusion.functions.now`
7070

7171
.. ipython:: python
7272
7373
df.select(f.now())
7474
75-
Convert to timestamps using :func:`.to_timestamp`
75+
Convert to timestamps using :py:func:`~datafusion.functions.to_timestamp`
7676

7777
.. ipython:: python
7878
@@ -92,7 +92,7 @@ DataFusion offers a range of helpful options.
9292
f.left(col('"Name"'), literal(4)).alias("code")
9393
)
9494
95-
This also includes the functions for regular expressions like :func:`.regexp_replace` and :func:`.regexp_match`
95+
This also includes the functions for regular expressions like :py:func:`~datafusion.functions.regexp_replace` and :py:func:`~datafusion.functions.regexp_match`
9696

9797
.. ipython:: python
9898
@@ -105,7 +105,7 @@ This also includes the functions for regular expressions like :func:`.regexp_rep
105105
Other
106106
-----
107107

108-
The function :func:`.in_list` allows to check a column for the presence of multiple values:
108+
The function :py:func:`~datafusion.functions.in_list` allows to check a column for the presence of multiple values:
109109

110110
.. ipython:: python
111111

docs/source/user-guide/common-operations/joins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Joins
1919
=====
2020

21-
DataFusion supports the following join variants via the method :meth:`.DataFrame.join`
21+
DataFusion supports the following join variants via the method :py:func:`~datafusion.dataframe.DataFrame.join`
2222

2323
- Inner Join
2424
- Left Join
@@ -58,7 +58,7 @@ will be included in the resulting DataFrame.
5858
5959
left.join(right, join_keys=(["customer_id"], ["id"]), how="inner")
6060
61-
The parameter :code:`join_keys` specifies the columns from the left DataFrame and right DataFrame that contains the values
61+
The parameter ``join_keys`` specifies the columns from the left DataFrame and right DataFrame that contains the values
6262
that should match.
6363

6464
Left Join

docs/source/user-guide/common-operations/select-and-filter.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Column Selections
1919
=================
2020

21-
Use :meth:`.DataFrame.select_columns` for basic column selection.
21+
Use :py:func:`~datafusion.dataframe.DataFrame.select` for basic column selection.
2222

2323
DataFusion can work with several file types, to start simple we can use a subset of the
2424
`TLC Trip Record Data <https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page>`_
@@ -35,8 +35,8 @@ DataFusion can work with several file types, to start simple we can use a subset
3535
df = ctx.read_parquet("yellow_trip_data.parquet")
3636
df.select_columns("trip_distance", "passenger_count")
3737
38-
For mathematical or logical operations use :func:`.col` to select columns, and give meaningful names to the resulting
39-
operations using :func:`.alias`
38+
For mathematical or logical operations use :py:func:`~datafusion.col` to select columns, and give meaningful names to the resulting
39+
operations using :py:func:`~datafusion.expr.Expr.alias`
4040

4141

4242
.. ipython:: python
@@ -48,7 +48,7 @@ operations using :func:`.alias`
4848

4949
Please be aware that all identifiers are effectively made lower-case in SQL, so if your file has capital letters
5050
(ex: Name) you must put your column name in double quotes or the selection won’t work. As an alternative for simple
51-
column selection use :meth:`.DataFrame.select_columns` without double quotes
51+
column selection use :py:func:`~datafusion.dataframe.DataFrame.select_columns` without double quotes
5252

5353
For selecting columns with capital letters use ``'"VendorID"'``
5454

@@ -57,7 +57,7 @@ For selecting columns with capital letters use ``'"VendorID"'``
5757
df.select(col('"VendorID"'))
5858
5959
60-
To combine it with literal values use the :func:`.lit`
60+
To combine it with literal values use the :py:func:`~datafusion.lit`
6161

6262
.. ipython:: python
6363

docs/source/user-guide/common-operations/udf-and-udfa.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ User Defined Functions
1919
======================
2020

2121
DataFusion provides powerful expressions and functions, reducing the need for custom Python functions.
22-
However you can still incorporate your own functions, i.e. User-Defined Functions (UDFs), with the :func:`.udf` function.
22+
However you can still incorporate your own functions, i.e. User-Defined Functions (UDFs), with the :py:func:`~datafusion.udf.ScalarUDF.udf` function.
2323

2424
.. ipython:: python
2525
@@ -42,7 +42,7 @@ However you can still incorporate your own functions, i.e. User-Defined Function
4242
4343
df.select(is_null_arr(col("a"))).to_pandas()
4444
45-
Additionally the :func:`.udaf` function allows you to define User-Defined Aggregate Functions (UDAFs)
45+
Additionally the :py:func:`~datafusion.udf.AggregateUDF.udaf` function allows you to define User-Defined Aggregate Functions (UDAFs)
4646

4747
.. code-block:: python
4848

docs/source/user-guide/common-operations/windows.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Window Functions
2121
In this section you will learn about window functions. A window function utilizes values from one or multiple rows to
2222
produce a result for each individual row, unlike an aggregate function that provides a single value for multiple rows.
2323

24-
The functionality of window functions in DataFusion is supported by the dedicated :func:`.window` function.
24+
The functionality of window functions in DataFusion is supported by the dedicated :py:func:`~datafusion.functions.window` function.
2525

2626
We'll use the pokemon dataset (from Ritchie Vink) in the following examples.
2727

@@ -40,7 +40,7 @@ We'll use the pokemon dataset (from Ritchie Vink) in the following examples.
4040
ctx = SessionContext()
4141
df = ctx.read_csv("pokemon.csv")
4242
43-
Here is an example that shows how to compare each pokemons’s attack power with the average attack power in its :code:`"Type 1"`
43+
Here is an example that shows how to compare each pokemons’s attack power with the average attack power in its ``"Type 1"``
4444

4545
.. ipython:: python
4646
@@ -54,7 +54,7 @@ Here is an example that shows how to compare each pokemons’s attack power with
5454
)
5555
5656
You can also control the order in which rows are processed by window functions by providing
57-
a list of :func:`.order_by` functions for the :code:`order_by` parameter.
57+
a list of ``order_by`` functions for the ``order_by`` parameter.
5858

5959
.. ipython:: python
6060

0 commit comments

Comments
 (0)