@@ -9,9 +9,9 @@ describe("dataframe", () => {
9
9
] ) ;
10
10
11
11
test ( "dtypes" , ( ) => {
12
- const expected = [ pl . Float64 , pl . Utf8 ] ;
12
+ const expected = [ pl . Float64 , pl . String ] ;
13
13
const actual = pl . DataFrame ( { a : [ 1 , 2 , 3 ] , b : [ "a" , "b" , "c" ] } ) . dtypes ;
14
- expect ( actual ) . toEqual ( expected ) ;
14
+ expect ( actual ) . toStrictEqual ( expected ) ;
15
15
} ) ;
16
16
test ( "height" , ( ) => {
17
17
const expected = 3 ;
@@ -447,7 +447,7 @@ describe("dataframe", () => {
447
447
ham : [ "a" , "b" , "c" ] ,
448
448
} )
449
449
. hashRows ( ) ;
450
- expect ( actual . dtype ) . toEqual ( pl . UInt64 ) ;
450
+ expect ( actual . dtype ) . toStrictEqual ( pl . UInt64 ) ;
451
451
} ) ;
452
452
test . each ( [ [ 1 ] , [ 1 , 2 ] , [ 1 , 2 , 3 ] , [ 1 , 2 , 3 , 4 ] ] ) (
453
453
"hashRows:positional" ,
@@ -458,7 +458,7 @@ describe("dataframe", () => {
458
458
ham : [ "a" , "b" , "c" ] ,
459
459
} )
460
460
. hashRows ( ...args ) ;
461
- expect ( actual . dtype ) . toEqual ( pl . UInt64 ) ;
461
+ expect ( actual . dtype ) . toStrictEqual ( pl . UInt64 ) ;
462
462
} ,
463
463
) ;
464
464
test . each ( [
@@ -473,7 +473,7 @@ describe("dataframe", () => {
473
473
ham : [ "a" , "b" , "c" ] ,
474
474
} )
475
475
. hashRows ( opts ) ;
476
- expect ( actual . dtype ) . toEqual ( pl . UInt64 ) ;
476
+ expect ( actual . dtype ) . toStrictEqual ( pl . UInt64 ) ;
477
477
} ) ;
478
478
test ( "head" , ( ) => {
479
479
const actual = pl
@@ -1777,8 +1777,8 @@ describe("create", () => {
1777
1777
date_nulls : pl . Date ,
1778
1778
datetime : pl . Datetime ( "ms" ) ,
1779
1779
datetime_nulls : pl . Datetime ( "ms" ) ,
1780
- string : pl . Utf8 ,
1781
- string_nulls : pl . Utf8 ,
1780
+ string : pl . String ,
1781
+ string_nulls : pl . String ,
1782
1782
categorical : pl . Categorical ,
1783
1783
categorical_nulls : pl . Categorical ,
1784
1784
list : pl . List ( pl . Float64 ) ,
@@ -1798,7 +1798,7 @@ describe("create", () => {
1798
1798
float_64_typed : pl . Float64 ,
1799
1799
} ;
1800
1800
const actual = df . schema ;
1801
- expect ( actual ) . toEqual ( expectedSchema ) ;
1801
+ expect ( actual ) . toStrictEqual ( expectedSchema ) ;
1802
1802
} ) ;
1803
1803
test ( "from series-array" , ( ) => {
1804
1804
const s1 = pl . Series ( "num" , [ 1 , 2 , 3 ] ) ;
@@ -1894,6 +1894,11 @@ describe("create", () => {
1894
1894
1895
1895
const df = pl . readRecords ( rows , { inferSchemaLength : 1 } ) ;
1896
1896
expect ( df . toRecords ( ) ) . toEqual ( expected ) ;
1897
+ expect ( df . schema ) . toStrictEqual ( {
1898
+ num : pl . Int32 ,
1899
+ date : pl . Datetime ( "ms" ) ,
1900
+ string : pl . String ,
1901
+ } ) ;
1897
1902
} ) ;
1898
1903
test ( "from row objects, with schema" , ( ) => {
1899
1904
const rows = [
@@ -1908,12 +1913,12 @@ describe("create", () => {
1908
1913
1909
1914
const schema = {
1910
1915
num : pl . Int32 ,
1911
- date : pl . Utf8 ,
1912
- string : pl . Utf8 ,
1916
+ date : pl . String ,
1917
+ string : pl . String ,
1913
1918
} ;
1914
1919
const df = pl . readRecords ( rows , { schema } ) ;
1915
1920
expect ( df . toRecords ( ) ) . toEqual ( expected ) ;
1916
- expect ( df . schema ) . toEqual ( schema ) ;
1921
+ expect ( df . schema ) . toStrictEqual ( schema ) ;
1917
1922
} ) ;
1918
1923
1919
1924
test ( "from nulls" , ( ) => {
@@ -1954,7 +1959,7 @@ describe("create", () => {
1954
1959
} ,
1955
1960
} ,
1956
1961
) ;
1957
- expect ( df . schema ) . toEqual ( { x : pl . Int32 , y : pl . String } ) ;
1962
+ expect ( df . schema ) . toStrictEqual ( { x : pl . Int32 , y : pl . String } ) ;
1958
1963
} ) ;
1959
1964
test ( "with schema" , ( ) => {
1960
1965
const df = pl . DataFrame (
@@ -1969,7 +1974,7 @@ describe("create", () => {
1969
1974
} ,
1970
1975
} ,
1971
1976
) ;
1972
- expect ( df . schema ) . toEqual ( { x : pl . Int32 , y : pl . String } ) ;
1977
+ expect ( df . schema ) . toStrictEqual ( { x : pl . Int32 , y : pl . String } ) ;
1973
1978
} ) ;
1974
1979
test ( "with schema overrides" , ( ) => {
1975
1980
const df = pl . DataFrame (
@@ -1983,7 +1988,7 @@ describe("create", () => {
1983
1988
} ,
1984
1989
} ,
1985
1990
) ;
1986
- expect ( df . schema ) . toEqual ( { a : pl . Int32 , b : pl . String } ) ;
1991
+ expect ( df . schema ) . toStrictEqual ( { a : pl . Int32 , b : pl . String } ) ;
1987
1992
} ) ;
1988
1993
test ( "errors if schemaOverrides and schema are both specified" , ( ) => {
1989
1994
const fn = ( ) =>
0 commit comments