-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from nextmv-io/develop
Release v0.20.4
- Loading branch information
Showing
118 changed files
with
16,334 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: json lint | ||
on: [push] | ||
jobs: | ||
sdk-json-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: git clone | ||
uses: actions/checkout@v3 | ||
|
||
- name: set up node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.17.1 | ||
|
||
- name: install prettier | ||
run: npm install [email protected] --global | ||
|
||
- name: lint .json files with prettier | ||
run: prettier -c "**/*.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tabWidth: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.20.3 | ||
v0.20.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package dataframe | ||
|
||
import "fmt" | ||
|
||
// Aggregation defines how to aggregate rows of a group of rows in a Groups | ||
// instance. | ||
type Aggregation interface { | ||
fmt.Stringer | ||
|
||
// Column returns the column the aggregation will be applied to. | ||
Column() Column | ||
|
||
// As returns the column to be used to identify the newly created column. | ||
// containing the aggregated value. | ||
As() Column | ||
} | ||
|
||
// Aggregations is the slice of Aggregation instances. | ||
type Aggregations []Aggregation | ||
|
||
// NumericAggregations defines the possible aggregations which can be applied on | ||
// columns of type Float and Int. | ||
type NumericAggregations interface { | ||
// Max creates an aggregation which reports the maximum value using | ||
// name as. | ||
Max(as string) Aggregation | ||
// Min creates an aggregation which reports the minimum value using | ||
// name as. | ||
Min(as string) Aggregation | ||
// Sum creates an aggregation which reports the sum of values using | ||
// name as. | ||
Sum(as string) Aggregation | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
package dataframe | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/nextmv-io/sdk/connect" | ||
) | ||
|
||
// Bools returns a BoolColumn identified by name. | ||
func Bools(name string) BoolColumn { | ||
connect.Connect(con, &newBoolColumn) | ||
return newBoolColumn(name) | ||
} | ||
|
||
// Floats returns a FloatColumn identified by name. | ||
func Floats(name string) FloatColumn { | ||
connect.Connect(con, &newFloatColumn) | ||
return newFloatColumn(name) | ||
} | ||
|
||
// Ints returns a IntColumn identified by name. | ||
func Ints(name string) IntColumn { | ||
connect.Connect(con, &newIntColumn) | ||
return newIntColumn(name) | ||
} | ||
|
||
// Strings returns a StringColumn identified by name. | ||
func Strings(name string) StringColumn { | ||
connect.Connect(con, &newStringColumn) | ||
return newStringColumn(name) | ||
} | ||
|
||
// DataType defines the types of colums available in DataFrame. | ||
type DataType string | ||
|
||
// Types of data in DataFrame. | ||
const ( | ||
// Bool type representing boolean true and false values. | ||
Bool DataType = "bool" | ||
// Int type representing int values. | ||
Int = "int" | ||
// Float type representing float64 values. | ||
Float = "float" | ||
// String type representing string values. | ||
String = "string" | ||
) | ||
|
||
// Column is a single column in a DataFrame instance. It is identified by its | ||
// name and has a DataType. | ||
type Column interface { | ||
fmt.Stringer | ||
|
||
// Name returns the name of the column, the name is the unique identifier | ||
// of the column within a DataFrame instance. | ||
Name() string | ||
|
||
// DataType returns the type of the column. | ||
DataType() DataType | ||
} | ||
|
||
// Columns is the slice of Column instances. | ||
type Columns []Column | ||
|
||
// BoolColumn is the typed column of type Bool. | ||
type BoolColumn interface { | ||
Column | ||
|
||
// IsFalse creates a filter to filter all rows having value false. | ||
IsFalse() Filter | ||
// IsTrue creates a filter to filter all rows having value true. | ||
IsTrue() Filter | ||
|
||
// Value return the value at row for dataframe df, | ||
// panics if out of bound. | ||
Value(df DataFrame, row int) bool | ||
|
||
// Values returns all the values in the column for dataframe df. | ||
Values(df DataFrame) []bool | ||
} | ||
|
||
// FloatColumn is the typed column of type Float. | ||
type FloatColumn interface { | ||
Column | ||
NumericAggregations | ||
|
||
// IsInRange creates a filter to filter all rows within range [min, max]. | ||
IsInRange(min, max float64) Filter | ||
|
||
// Value return the value at row, panics if out of bound. | ||
Value(df DataFrame, row int) float64 | ||
|
||
// Values returns all the values in the column. | ||
Values(df DataFrame) []float64 | ||
} | ||
|
||
// IntColumn is the typed column of type Int. | ||
type IntColumn interface { | ||
Column | ||
NumericAggregations | ||
|
||
// IsInRange creates a filter to filter all value within range [min, max]. | ||
IsInRange(min, max int) Filter | ||
|
||
// Value return the value at row, panics if out of bound. | ||
Value(df DataFrame, row int) int | ||
|
||
// Values returns all the values in the column. | ||
Values(df DataFrame) []int | ||
} | ||
|
||
// StringColumn is the typed column of type String. | ||
type StringColumn interface { | ||
Column | ||
|
||
// Equals creates a filter to filter all rows having value value. | ||
Equals(value string) Filter | ||
|
||
// Value return the value at row, panics if out of bound. | ||
Value(df DataFrame, row int) *string | ||
|
||
// Values returns all the values in the column. | ||
Values(df DataFrame) []*string | ||
} | ||
|
||
var ( | ||
newBoolColumn func(string) BoolColumn | ||
newFloatColumn func(string) FloatColumn | ||
newIntColumn func(string) IntColumn | ||
newStringColumn func(string) StringColumn | ||
) |
Oops, something went wrong.