Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.4.1 #353

Merged
merged 3 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .eslintrc.js

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Arquero is Spanish for "archer": if datasets are [arrows](https://arrow.apache.o

## API Documentation

* [Top-Level API](https://uwdata.github.io/arquero/api) - All methods in the top-level Arquero namespace.
* [Table](https://uwdata.github.io/arquero/api/table) - Table access and output methods.
* [Verbs](https://uwdata.github.io/arquero/api/verbs) - Table transformation verbs.
* [Op Functions](https://uwdata.github.io/arquero/api/op) - All functions, including aggregate and window functions.
* [Expressions](https://uwdata.github.io/arquero/api/expressions) - Parsing and generation of table expressions.
* [Extensibility](https://uwdata.github.io/arquero/api/extensibility) - Extend Arquero with new expression functions or table verbs.
* [Top-Level API](https://idl.uw.edu/arquero/api) - All methods in the top-level Arquero namespace.
* [Table](https://idl.uw.edu/arquero/api/table) - Table access and output methods.
* [Verbs](https://idl.uw.edu/arquero/api/verbs) - Table transformation verbs.
* [Op Functions](https://idl.uw.edu/arquero/api/op) - All functions, including aggregate and window functions.
* [Expressions](https://idl.uw.edu/arquero/api/expressions) - Parsing and generation of table expressions.
* [Extensibility](https://idl.uw.edu/arquero/api/extensibility) - Extend Arquero with new expression functions or table verbs.

## Example

Expand Down Expand Up @@ -80,7 +80,7 @@ To use in the browser, you can load Arquero from a content delivery network:
<script src="https://cdn.jsdelivr.net/npm/arquero@latest"></script>
```

Arquero will be imported into the `aq` global object. The default browser bundle does not include the [Apache Arrow](https://arrow.apache.org/) library. To perform Arrow encoding using [toArrow()](https://uwdata.github.io/arquero/api/#toArrow) or binary file loading using [loadArrow()](https://uwdata.github.io/arquero/api/#loadArrow), import Apache Arrow first:
Arquero will be imported into the `aq` global object. The default browser bundle does not include the [Apache Arrow](https://arrow.apache.org/) library. To perform Arrow encoding using [toArrow()](https://idl.uw.edu/arquero/api/#toArrow) or binary file loading using [loadArrow()](https://idl.uw.edu/arquero/api/#loadArrow), import Apache Arrow first:

```html
<script src="https://cdn.jsdelivr.net/npm/apache-arrow@latest"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/expressions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Expressions \| Arquero API Reference
---
# Arquero API Reference <a href="https://uwdata.github.io/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>
# Arquero API Reference <a href="https://idl.uw.edu/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>

[Top-Level](/arquero/api) | [Table](table) | [Verbs](verbs) | [Op Functions](op) | [**Expressions**](expressions) | [Extensibility](extensibility)

Expand Down
2 changes: 1 addition & 1 deletion docs/api/extensibility.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Extensibility \| Arquero API Reference
---
# Arquero API Reference <a href="https://uwdata.github.io/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>
# Arquero API Reference <a href="https://idl.uw.edu/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>

[Top-Level](/arquero/api) | [Table](table) | [Verbs](verbs) | [Op Functions](op) | [Expressions](expressions) | [**Extensibility**](extensibility)

Expand Down
26 changes: 13 additions & 13 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create a new <a href="table">table</a> for a set of named *columns*, optionally

JavaScript objects have specific key ordering rules: keys are enumerated in the order they are assigned, except for integer keys, which are enumerated first in sorted order. As a result, when using a standard object any *columns* entries with integer keys are listed first regardless of their order in the object definition. Use the *names* argument to ensure proper column ordering is respected. Map and entry arrays will preserve name ordering, in which case the *names* argument is only needed if you wish to specify an ordering different from the *columns* input.

To bind together columns from multiple tables with the same number of rows, use the table [assign](table/#assign) method. To transform the table, use the various [verb](verbs) methods.
To bind together columns from multiple tables with the same number of rows, use the table [assign](table#assign) method. To transform the table, use the various [verb](verbs) methods.

* *columns*: An object or Map providing a named set of column arrays, or an entries array of the form `[[name, values], ...]`. Keys are column name strings; the enumeration order of the keys determines the column indices if the *names* argument is not provided. Column values should be arrays (or array-like values) of identical length.
* *names*: An array of column names, specifying the index order of columns in the table.
Expand Down Expand Up @@ -492,7 +492,7 @@ All table expression operations, including standard functions, aggregate functio
<hr/><a id="agg" href="#agg">#</a>
<em>aq</em>.<b>agg</b>(<i>table</i>, <i>expression</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/verbs/helpers/agg.js)

Compute a single aggregate value for a table. This method is a convenient shortcut for ungrouping a table, applying a [rollup](verbs/#rollup) verb for a single aggregate expression, and extracting the resulting aggregate value.
Compute a single aggregate value for a table. This method is a convenient shortcut for ungrouping a table, applying a [rollup](verbs#rollup) verb for a single aggregate expression, and extracting the resulting aggregate value.

* *table*: An Arquero table.
* *expression*: An aggregate-valued table expression. Aggregate functions are permitted, and will take into account any [orderby](#orderby) settings. Window functions are not permitted and any [groupby](#groupby) settings will be ignored.
Expand All @@ -511,9 +511,9 @@ aq.agg(aq.table({ a: [1, 3, 5] }), d => [op.min(d.a), op.max('a')]) // [1, 5]
<hr/><a id="escape" href="#escape">#</a>
<em>aq</em>.<b>escape</b>(<i>value</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/escape.js)

Annotate a JavaScript function or *value* to bypass Arquero's default table expression handling. Escaped values enable the direct use of JavaScript functions to process row data: no internal parsing or code generation is performed, and so [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures) and arbitrary function invocations are supported. Escaped values provide a lightweight alternative to [table params](https://uwdata.github.io/arquero/api/table#params) and [function registration](https://uwdata.github.io/arquero/api/extensibility#addFunction) to access variables in enclosing scopes.
Annotate a JavaScript function or *value* to bypass Arquero's default table expression handling. Escaped values enable the direct use of JavaScript functions to process row data: no internal parsing or code generation is performed, and so [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures) and arbitrary function invocations are supported. Escaped values provide a lightweight alternative to [table params](table#params) and [function registration](extensibility#addFunction) to access variables in enclosing scopes.

An escaped value can be applied anywhere Arquero accepts [single-table table expressions](https://uwdata.github.io/arquero/api/expressions#table), including the [derive](verbs/#derive), [filter](verbs/#filter), and [spread](verbs/#spread) verbs. In addition, any of the [standard `op` functions](https://uwdata.github.io/arquero/api/op#functions) can be used within an escaped function. However, aggregate and window `op` functions are not supported. Also note that using escaped values will break [serialization of Arquero queries to worker threads](https://github.com/uwdata/arquero-worker).
An escaped value can be applied anywhere Arquero accepts [single-table table expressions](expressions#table), including the [derive](verbs#derive), [filter](verbs#filter), and [spread](verbs#spread) verbs. In addition, any of the [standard `op` functions](op#functions) can be used within an escaped function. However, aggregate and window `op` functions are not supported. Also note that using escaped values will break [serialization of Arquero queries to worker threads](https://github.com/uwdata/arquero-worker).

* *value*: A literal value or a function that is passed a row object and params object as input. Aggregate and window `op` functions are not permitted.

Expand Down Expand Up @@ -589,7 +589,7 @@ aq.desc(d => op.lower(d.colA))
<hr/><a id="frac" href="#frac">#</a>
<em>aq</em>.<b>frac</b>(<i>fraction</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/frac.js)

Generate a table expression that computes the number of rows corresponding to a given fraction for each group. The resulting string can be used as part of the input to the [sample](verbs/#sample) verb.
Generate a table expression that computes the number of rows corresponding to a given fraction for each group. The resulting string can be used as part of the input to the [sample](verbs#sample) verb.

* *fraction*: The fractional value.

Expand All @@ -606,7 +606,7 @@ Annotate a table expression to compute rolling aggregate or window functions wit

* *expr*: The table expression to annotate.
* *frame*:The sliding window frame offsets. Each entry indicates an offset from the current value. If an entry is non-finite, the frame will be unbounded in that direction, including all preceding or following values. If unspecified or `null`, the default frame `[-Infinity, 0]` includes the current values and all preceding values.
* *includePeers*: Boolean flag indicating if the sliding window frame should ignore peer (tied) values. If `false` (the default), the window frame boundaries are insensitive to peer values. If `true`, the window frame expands to include all peers. This parameter only affects operations that depend on the window frame: namely [aggregate functions](op/#aggregate-functions) and the [first_value](op/#first_value), [last_value](op/#last_value), and [nth_value](op/#last_values) window functions.
* *includePeers*: Boolean flag indicating if the sliding window frame should ignore peer (tied) values. If `false` (the default), the window frame boundaries are insensitive to peer values. If `true`, the window frame expands to include all peers. This parameter only affects operations that depend on the window frame: namely [aggregate functions](op#aggregate-functions) and the [first_value](op#first_value), [last_value](op#last_value), and [nth_value](op#last_values) window functions.

*Examples*

Expand Down Expand Up @@ -653,12 +653,12 @@ aq.seed(null)

## <a id="selection-helpers">Selection Helpers</a>

Methods for selecting columns. The result of these methods can be passed as arguments to [select](verbs/#select), [groupby](verbs/#groupby), [join](verbs/#join) and other transformation verbs.
Methods for selecting columns. The result of these methods can be passed as arguments to [select](verbs#select), [groupby](verbs#groupby), [join](verbs#join) and other transformation verbs.

<hr/><a id="all" href="#all">#</a>
<em>aq</em>.<b>all</b>() · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Select all columns in a table. Returns a function-valued selection compatible with [select](verbs/#select).
Select all columns in a table. Returns a function-valued selection compatible with [select](verbs#select).

*Examples*

Expand All @@ -670,7 +670,7 @@ aq.all()
<hr/><a id="not" href="#not">#</a>
<em>aq</em>.<b>not</b>(<i>selection</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Negate a column *selection*, selecting all other columns in a table. Returns a function-valued selection compatible with [select](verbs/#select).
Negate a column *selection*, selecting all other columns in a table. Returns a function-valued selection compatible with [select](verbs#select).

* *selection*: The selection to negate. May be a column name, column index, array of either, or a selection function (e.g., from [range](#range)).

Expand All @@ -688,7 +688,7 @@ aq.not(aq.range(2, 5))
<hr/><a id="range" href="#range">#</a>
<em>aq</em>.<b>range</b>(<i>start</i>, <i>stop</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Select a contiguous range of columns. Returns a function-valued selection compatible with [select](verbs/#select).
Select a contiguous range of columns. Returns a function-valued selection compatible with [select](verbs#select).

* *start*: The name or integer index of the first selected column.
* *stop*: The name or integer index of the last selected column.
Expand All @@ -706,7 +706,7 @@ aq.range(2, 5)
<hr/><a id="matches" href="#matches">#</a>
<em>aq</em>.<b>matches</b>(<i>pattern</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Select all columns whose names match a pattern. Returns a function-valued selection compatible with [select](verbs/#select).
Select all columns whose names match a pattern. Returns a function-valued selection compatible with [select](verbs#select).

* *pattern*: A string or [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) pattern to match.

Expand All @@ -725,7 +725,7 @@ aq.matches(/^[abc]/i)
<hr/><a id="startswith" href="#startswith">#</a>
<em>aq</em>.<b>startswith</b>(<i>string</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Select all columns whose names start with a string. Returns a function-valued selection compatible with [select](verbs/#select).
Select all columns whose names start with a string. Returns a function-valued selection compatible with [select](verbs#select).

* *string*: The string to match at the start of the column name.

Expand All @@ -738,7 +738,7 @@ aq.startswith('prefix_')
<hr/><a id="endswith" href="#endswith">#</a>
<em>aq</em>.<b>endswith</b>(<i>string</i>) · [Source](https://github.com/uwdata/arquero/blob/master/src/helpers/selection.js)

Select all columns whose names end with a string. Returns a function-valued selection compatible with [select](verbs/#select).
Select all columns whose names end with a string. Returns a function-valued selection compatible with [select](verbs#select).

* *string*: The string to match at the end of the column name.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/op.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Operations \| Arquero API Reference
---
# Arquero API Reference <a href="https://uwdata.github.io/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>
# Arquero API Reference <a href="https://idl.uw.edu/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>

[Top-Level](/arquero/api) | [Table](table) | [Verbs](verbs) | [**Op Functions**](op) | [Expressions](expressions) | [Extensibility](extensibility)

Expand Down
2 changes: 1 addition & 1 deletion docs/api/table.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Table \| Arquero API Reference
---
# Arquero API Reference <a href="https://uwdata.github.io/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>
# Arquero API Reference <a href="https://idl.uw.edu/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>

[Top-Level](/arquero/api) | [**Table**](table) | [Verbs](verbs) | [Op Functions](op) | [Expressions](expressions) | [Extensibility](extensibility)

Expand Down
2 changes: 1 addition & 1 deletion docs/api/verbs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Verbs \| Arquero API Reference
---
# Arquero API Reference <a href="https://uwdata.github.io/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>
# Arquero API Reference <a href="https://idl.uw.edu/arquero"><img align="right" src="../assets/logo.svg" height="38"/></a>

[Top-Level](/arquero/api) | [Table](table) | [**Verbs**](verbs) | [Op Functions](op) | [Expressions](expressions) | [Extensibility](extensibility)

Expand Down
32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import js from '@eslint/js';
import globals from 'globals';

/** @type {import('@types/eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es6,
globalThis: false
}
},
rules: {
'comma-dangle': ['error', 'never'],
'no-console': 'error',
'no-cond-assign': 'off',
'no-fallthrough': ['error', { commentPattern: 'break omitted' }],
'semi': 'error',
'quotes': ['error', 'single', { avoidEscape: true }],
'prefer-const': 'error',
'sort-imports': ['error', {
ignoreCase: false,
ignoreDeclarationSort: true
}]
}
}
];
Loading