Skip to content

Commit

Permalink
couple small docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
drizk1 committed Jan 8, 2025
1 parent 58b9890 commit 3aa5eae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 4 additions & 2 deletions docs/examples/UserGuide/ex_joining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ## General Syntax
# All joins share the same argument format
# - `*_join(query, join_table, joining_keys...)
# - `*_join(query, join_table, joining_keys...)`

# ## Equi Joins
# Equi joins can be written in any of the following ways, and the key column will be dropped from the right hand (new) table to avoid duplication.
Expand Down Expand Up @@ -159,7 +159,7 @@

# ## AsOf/Rolling join
# This example reproduces an example in the (DuckDB Docs)[https://duckdb.org/docs/guides/sql_features/asof_join.html#what-is-an-asof-join]
# ```
# ```julia
# prices = db_table(db, "https://duckdb.org/data/prices.csv", "prices")
# holdings = db_table(db, "https://duckdb.org/data/holdings.csv", "holdings")

Expand All @@ -169,6 +169,8 @@
# @mutate(value = price * shares)
# @collect
# end
# ```
# ```
# 4×3 DataFrame
# Row │ ticker when value
# │ String DateTime Float64
Expand Down
13 changes: 6 additions & 7 deletions docs/examples/UserGuide/from_queryex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# ## Setup
# ```julia
# import TidierDB as DB
# con = DB.connect(duckdb())
# con = DB.connect(DB.duckdb())
# mtcars_path = "https://gist.githubusercontent.com/seankross/a412dfbd88b3db70b74b/raw/5f23f993cd87c283ce766e7ac6b329ee7cc2e1d1/mtcars.csv"
# mtcars = DB.db_table(con, mtcars_path)
# mtcars = DB.db_table(con, mtcars_path);
# ```

# Start a query to analyze fuel efficiency by number of cylinders. However, to further build on this query later, end the chain without using `@show_query` or `@collect`
Expand Down Expand Up @@ -49,8 +49,8 @@
# ## @create_view
# This can also be done with `@create_view`.
# ```julia
# query2 = @chain t(mtcars) @filter(mpg>20) @mutate(mpg = mpg *4);
# DB.@chain DB.db_table(db, "mtcars") begin
# query2 = @chain DB.t(mtcars) DB.@filter(mpg>20) DB.@mutate(mpg = mpg *4);
# DB.@chain DB.t(mtcars) begin
# DB.@group_by cyl
# DB.@summarize begin
# across(mpg, (mean, minimum, maximum))
Expand All @@ -66,10 +66,9 @@
# end;
#
#
# DB.@chain DB.db_table(db, "viewer") begin
# DB.@chain DB.db_table(con, "viewer") begin
# DB.@left_join(DB.t(query2), cyl == cyl)
# DB.@group_by(efficiency)
# DB.@summarize(avg_mean = mean(mpg))
# DB.@summarize(avg_mean = mean(mpg), _by = efficiency)
# DB.@mutate(mean = avg_mean / 4 )
# @aside DB.@show_query _
# DB.@collect
Expand Down

0 comments on commit 3aa5eae

Please sign in to comment.