Skip to content

Commit

Permalink
Upgrading biome (#274)
Browse files Browse the repository at this point in the history
Upgrading biome to latest
Sorting imports as suggested by biome
Adding `node:` prefix to imports as suggested by biome
  • Loading branch information
Bidek56 authored Sep 30, 2024
1 parent 4bcc68c commit 28e13fb
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 150 deletions.
4 changes: 2 additions & 2 deletions __tests__/dataframe.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import { Stream } from "node:stream";
/* eslint-disable newline-per-chained-call */
import pl from "@polars";
import { Stream } from "stream";
import fs from "fs";
describe("dataframe", () => {
const df = pl.DataFrame([
pl.Series("foo", [1, 2, 9], pl.Int16),
Expand Down
6 changes: 3 additions & 3 deletions __tests__/io.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { Stream } from "node:stream";
import pl from "@polars";
import path from "path";
import { Stream } from "stream";
import fs from "fs";
// eslint-disable-next-line no-undef
const csvpath = path.resolve(__dirname, "./examples/datasets/foods1.csv");
// eslint-disable-next-line no-undef
Expand Down
2 changes: 1 addition & 1 deletion __tests__/lazyframe.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from "node:fs";
import pl from "@polars";
import fs from "fs";

describe("lazyframe", () => {
test("columns", () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/serde.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import pl from "@polars";
import path from "path";
// eslint-disable-next-line no-undef
const csvpath = path.resolve(__dirname, "./examples/datasets/foods1.csv");
describe("serde", () => {
Expand Down
8 changes: 2 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": false
},
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "off",
"useNodejsImportProtocol": "off"
"noParameterAssign": "off"
},
"suspicious": {
"noExplicitAny": "off",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
"precommit": "yarn lint && yarn test"
},
"devDependencies": {
"@biomejs/biome": "=1.8.3",
"@biomejs/biome": "=1.9.2",
"@napi-rs/cli": "^2.18.4",
"@types/chance": "^1.1.6",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@types/jest": "^29.5.13",
"@types/node": "^22.5.5",
"chance": "^1.1.12",
"jest": "^29.7.0",
"source-map-support": "^0.5.21",
Expand Down
20 changes: 10 additions & 10 deletions polars/dataframe.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import pli from "./internals/polars_internal";
import { arrayToJsDataFrame } from "./internals/construction";
import { Stream, Writable } from "node:stream";
import { concat } from "./functions";
import {
_GroupBy,
DynamicGroupBy,
type GroupBy,
RollingGroupBy,
_GroupBy,
} from "./groupby";
import { _LazyDataFrame, type LazyDataFrame } from "./lazy/dataframe";
import { concat } from "./functions";
import { arrayToJsDataFrame } from "./internals/construction";
import pli from "./internals/polars_internal";
import { type LazyDataFrame, _LazyDataFrame } from "./lazy/dataframe";
import { Expr } from "./lazy/expr";
import { _Series, Series } from "./series";
import { Stream, Writable } from "stream";
import { Series, _Series } from "./series";
import type {
FillNullStrategy,
JoinOptions,
Expand All @@ -23,13 +23,13 @@ import type {
import { DataType } from "./datatypes";

import {
columnOrColumns,
columnOrColumnsStrict,
type ColumnSelection,
type ColumnsOrExpr,
type ExprOrString,
isSeriesArray,
type ValueOrArray,
columnOrColumns,
columnOrColumnsStrict,
isSeriesArray,
} from "./utils";

import type {
Expand Down
8 changes: 4 additions & 4 deletions polars/functions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type DataFrame, _DataFrame } from "./dataframe";
/* eslint-disable no-redeclare */
import { jsTypeToPolarsType } from "./internals/construction";
import { type Series, _Series } from "./series";
import { type DataFrame, _DataFrame } from "./dataframe";
import { type LazyDataFrame, _LazyDataFrame } from "./lazy/dataframe";
import pli from "./internals/polars_internal";
import { isDataFrameArray, isLazyDataFrameArray, isSeriesArray } from "./utils";
import { type LazyDataFrame, _LazyDataFrame } from "./lazy/dataframe";
import { type Series, _Series } from "./series";
import type { ConcatOptions } from "./types";
import { isDataFrameArray, isLazyDataFrameArray, isSeriesArray } from "./utils";

/**
* _Repeat a single value n times and collect into a Series._
Expand Down
4 changes: 2 additions & 2 deletions polars/groupby.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import util from "node:util";
import { type DataFrame, _DataFrame } from "./dataframe";
import * as utils from "./utils";
import util from "util";
import type { Expr } from "./lazy/expr";
import { col, exclude } from "./lazy/functions";
import * as utils from "./utils";
import type { ColumnsOrExpr, StartBy } from "./utils";

const inspect = Symbol.for("nodejs.util.inspect.custom");
Expand Down
6 changes: 3 additions & 3 deletions polars/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as series from "./series";
import * as df from "./dataframe";
import { DataType, Field as _field } from "./datatypes";
import * as series from "./series";
export { DataType } from "./datatypes";
import * as cfg from "./cfg";
import * as func from "./functions";
import pli from "./internals/polars_internal";
import * as io from "./io";
import * as cfg from "./cfg";
import * as ldf from "./lazy/dataframe";
import pli from "./internals/polars_internal";
export * from "./series";
export * from "./dataframe";
export * from "./functions";
Expand Down
8 changes: 4 additions & 4 deletions polars/internals/construction.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pli from "./polars_internal";
import { DataType, polarsTypeToConstructor } from "../datatypes";
import { isTypedArray } from "util/types";
import { Series } from "../series";
import { isTypedArray } from "node:util/types";
import { _DataFrame } from "../dataframe";
import { DataType, polarsTypeToConstructor } from "../datatypes";
import { FixedSizeList, TimeUnit } from "../datatypes/datatype";
import { Field } from "../datatypes/field";
import { Series } from "../series";
import pli from "./polars_internal";

export const jsTypeToPolarsType = (value: unknown): DataType => {
if (value === null) {
Expand Down
10 changes: 5 additions & 5 deletions polars/io.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type Readable, Stream } from "node:stream";
import { type DataFrame, _DataFrame } from "./dataframe";
import type { DataType } from "./datatypes";
import { concat } from "./functions";
import pli from "./internals/polars_internal";
import { type DataFrame, _DataFrame } from "./dataframe";
import { isPath } from "./utils";
import { type LazyDataFrame, _LazyDataFrame } from "./lazy/dataframe";
import { type Readable, Stream } from "stream";
import { concat } from "./functions";
import type { ScanParquetOptions, RowCount } from "./types";
import type { RowCount, ScanParquetOptions } from "./types";
import { isPath } from "./utils";

export interface ReadCsvOptions {
inferSchemaLength: number | null;
Expand Down
24 changes: 12 additions & 12 deletions polars/lazy/dataframe.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { type DataFrame, _DataFrame } from "../dataframe";
import { Expr, exprToLitOrExpr } from "./expr";
import pli from "../internals/polars_internal";
import {
columnOrColumnsStrict,
type ColumnSelection,
type ColumnsOrExpr,
type ExprOrString,
selectionToExprList,
type ValueOrArray,
} from "../utils";
import { _LazyGroupBy, type LazyGroupBy } from "./groupby";
import type { Series } from "../series";
import type { Deserialize, GroupByOps, Serialize } from "../shared_traits";
import type {
LazyOptions,
LazyJoinOptions,
LazyOptions,
SinkCsvOptions,
SinkParquetOptions,
} from "../types";
import type { Series } from "../series";
import {
type ColumnSelection,
type ColumnsOrExpr,
type ExprOrString,
type ValueOrArray,
columnOrColumnsStrict,
selectionToExprList,
} from "../utils";
import { Expr, exprToLitOrExpr } from "./expr";
import { type LazyGroupBy, _LazyGroupBy } from "./groupby";

const inspect = Symbol.for("nodejs.util.inspect.custom");

Expand Down
18 changes: 9 additions & 9 deletions polars/lazy/expr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ export type { ExprList as ListNamespace } from "./list";
export type { ExprDateTime as DatetimeNamespace } from "./datetime";
export type { ExprStruct as StructNamespace } from "./struct";

import { isRegExp } from "node:util/types";
import type { DataType } from "../../datatypes";
import pli from "../../internals/polars_internal";
import {
type ExprOrString,
selectionToExprList,
INSPECT_SYMBOL,
regexToString,
} from "../../utils";
import { Series } from "../../series";
import type {
Arithmetic,
Comparison,
Cumulative,
Deserialize,
EwmOps,
Rolling,
Round,
Sample,
Serialize,
EwmOps,
} from "../../shared_traits";
import type {
InterpolationMethod,
FillNullStrategy,
InterpolationMethod,
RankMethod,
} from "../../types";
import { isRegExp } from "util/types";
import {
type ExprOrString,
INSPECT_SYMBOL,
regexToString,
selectionToExprList,
} from "../../utils";
/**
* Expressions that can be used in various contexts.
*/
Expand Down
6 changes: 3 additions & 3 deletions polars/lazy/expr/list.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Expr, _Expr, exprToLitOrExpr } from "../expr";
import type { ListFunctions } from "../../shared_traits";
import { Series } from "../../series";
import pli from "../../internals/polars_internal";
import { Series } from "../../series";
import type { ListFunctions } from "../../shared_traits";
import { Expr, _Expr, exprToLitOrExpr } from "../expr";
import { concatList } from "../functions";

/**
Expand Down
2 changes: 1 addition & 1 deletion polars/lazy/expr/string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { StringFunctions } from "../../shared_traits";
import { DataType } from "../../datatypes";
import type { StringFunctions } from "../../shared_traits";
import { regexToString } from "../../utils";
import { Expr, _Expr, exprToLitOrExpr } from "../expr";
import { lit } from "../functions";
Expand Down
2 changes: 1 addition & 1 deletion polars/lazy/expr/struct.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _Expr, type Expr } from "../expr";
import { type Expr, _Expr } from "../expr";

/**
* Struct functions
Expand Down
6 changes: 3 additions & 3 deletions polars/lazy/functions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Expr, _Expr, exprToLitOrExpr } from "./expr";
import { DataFrame } from "../dataframe";
import { DataType } from "../datatypes";
import pli from "../internals/polars_internal";
import { Series } from "../series";
import { DataFrame } from "../dataframe";
import { type ExprOrString, range, selectionToExprList } from "../utils";
import pli from "../internals/polars_internal";
import { Expr, _Expr, exprToLitOrExpr } from "./expr";

/**
* __A column in a DataFrame.__
Expand Down
4 changes: 2 additions & 2 deletions polars/lazy/groupby.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Expr } from "./expr";
import { selectionToExprList } from "../utils";
import { _LazyDataFrame, type LazyDataFrame } from "./dataframe";
import { type LazyDataFrame, _LazyDataFrame } from "./dataframe";
import type { Expr } from "./expr";

/** @ignore */
export const _LazyGroupBy = (_lgb: any): LazyGroupBy => {
Expand Down
2 changes: 1 addition & 1 deletion polars/lazy/whenthen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Expr } from "./expr";
import pli from "../internals/polars_internal";
import { Expr } from "./expr";

export interface When {
/** Values to return in case of the predicate being `true`.*/
Expand Down
28 changes: 14 additions & 14 deletions polars/series/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import pli from "../internals/polars_internal";
import { arrayToJsSeries } from "../internals/construction";
import { DataType, DTYPE_TO_FFINAME, type Optional } from "../datatypes";
import { DataFrame, _DataFrame } from "../dataframe";
import { SeriesStringFunctions, type StringNamespace } from "./string";
import { type ListNamespace, SeriesListFunctions } from "./list";
import { SeriesDateFunctions } from "./datetime";
import { SeriesStructFunctions } from "./struct";
import { DTYPE_TO_FFINAME, DataType, type Optional } from "../datatypes";
import type {
DTypeToJs,
DtypeToJsName,
JsToDtype,
JsType,
} from "../datatypes/datatype";
import { InvalidOperationError } from "../error";
import { arrayToJsSeries } from "../internals/construction";
import pli from "../internals/polars_internal";
import { col } from "../lazy/functions";
import type {
Arithmetic,
Comparison,
Expand All @@ -18,14 +21,11 @@ import type {
Sample,
Serialize,
} from "../shared_traits";
import { col } from "../lazy/functions";
import type { InterpolationMethod, RankMethod } from "../types";
import type {
DTypeToJs,
DtypeToJsName,
JsToDtype,
JsType,
} from "../datatypes/datatype";
import { SeriesDateFunctions } from "./datetime";
import { type ListNamespace, SeriesListFunctions } from "./list";
import { SeriesStringFunctions, type StringNamespace } from "./string";
import { SeriesStructFunctions } from "./struct";

const inspect = Symbol.for("nodejs.util.inspect.custom");
/**
Expand Down
6 changes: 3 additions & 3 deletions polars/series/string.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Expr } from "./../lazy/expr/index";
import { type Series, _Series } from ".";
import type { DataType } from "../datatypes";
import { _Series, type Series } from ".";
import { regexToString } from "../utils";
import { col } from "../lazy/functions";
import type { StringFunctions } from "../shared_traits";
import { regexToString } from "../utils";
import type { Expr } from "./../lazy/expr/index";

/**
* namespace containing series string functions
Expand Down
4 changes: 2 additions & 2 deletions polars/series/struct.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Series, _Series } from ".";
import { DataFrame, _DataFrame } from "../dataframe";
import pli from "../internals/polars_internal";
import { _DataFrame, DataFrame } from "../dataframe";
import { _Series, type Series } from ".";
import { _Expr } from "../lazy/expr";

export interface SeriesStructFunctions {
Expand Down
6 changes: 3 additions & 3 deletions polars/shared_traits.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { ColumnsOrExpr, StartBy } from "./utils";
import { type Expr, _Expr } from "./lazy/expr";
import type { ColumnsOrExpr, StartBy } from "./utils";

import type { DataType } from "./datatypes";
import type {
ClosedWindow,
InterpolationMethod,
RollingOptions,
RollingQuantileOptions,
RollingSkewOptions,
ClosedWindow,
} from "./types";
import type { DataType } from "./datatypes";

/**
* Arithmetic operations
Expand Down
Loading

0 comments on commit 28e13fb

Please sign in to comment.