@gradio/dataframe 0.21.5 → 0.21.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/shared/utils/utils.js +3 -0
- package/package.json +6 -6
- package/shared/utils/utils.ts +3 -0
- package/test/table_utils.test.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.21.6
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12890](https://github.com/gradio-app/gradio/pull/12890) [`ac29df8`](https://github.com/gradio-app/gradio/commit/ac29df82a735c72c021c07e0816f78001147671b) - fix DataFrame NaN values becoming 0 after sorting. Thanks @Mr-Neutr0n!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/client@2.1.0
|
|
12
|
+
- @gradio/button@0.6.4
|
|
13
|
+
|
|
3
14
|
## 0.21.5
|
|
4
15
|
|
|
5
16
|
### Dependency updates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.6",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"d3-dsv": "^3.0.1",
|
|
15
15
|
"dequal": "^2.0.3",
|
|
16
16
|
"@gradio/atoms": "^0.22.0",
|
|
17
|
-
"@gradio/button": "^0.6.
|
|
17
|
+
"@gradio/button": "^0.6.4",
|
|
18
|
+
"@gradio/client": "^2.1.0",
|
|
18
19
|
"@gradio/checkbox": "^0.6.3",
|
|
19
|
-
"@gradio/client": "^2.0.4",
|
|
20
|
-
"@gradio/markdown-code": "^0.6.1",
|
|
21
20
|
"@gradio/icons": "^0.15.1",
|
|
21
|
+
"@gradio/markdown-code": "^0.6.1",
|
|
22
22
|
"@gradio/upload": "^0.17.6",
|
|
23
|
-
"@gradio/
|
|
24
|
-
"@gradio/
|
|
23
|
+
"@gradio/statustracker": "^0.12.4",
|
|
24
|
+
"@gradio/utils": "^0.11.3"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
package/shared/utils/utils.ts
CHANGED
|
@@ -29,6 +29,9 @@ export type DataframeValue = {
|
|
|
29
29
|
* @returns The coerced value.
|
|
30
30
|
*/
|
|
31
31
|
export function cast_value_to_type(v: any, t: Datatype): CellValue {
|
|
32
|
+
if (v === null || v === undefined) {
|
|
33
|
+
return v;
|
|
34
|
+
}
|
|
32
35
|
if (t === "number") {
|
|
33
36
|
const n = Number(v);
|
|
34
37
|
return isNaN(n) ? v : n;
|
package/test/table_utils.test.ts
CHANGED
|
@@ -163,4 +163,14 @@ describe("cast_value_to_type", () => {
|
|
|
163
163
|
expect(cast_value_to_type("hello", "str")).toBe("hello");
|
|
164
164
|
expect(cast_value_to_type(123, "str")).toBe(123);
|
|
165
165
|
});
|
|
166
|
+
test("preserves null and undefined for all types", () => {
|
|
167
|
+
expect(cast_value_to_type(null, "number")).toBe(null);
|
|
168
|
+
expect(cast_value_to_type(undefined, "number")).toBe(undefined);
|
|
169
|
+
expect(cast_value_to_type(null, "bool")).toBe(null);
|
|
170
|
+
expect(cast_value_to_type(undefined, "bool")).toBe(undefined);
|
|
171
|
+
expect(cast_value_to_type(null, "date")).toBe(null);
|
|
172
|
+
expect(cast_value_to_type(undefined, "date")).toBe(undefined);
|
|
173
|
+
expect(cast_value_to_type(null, "str")).toBe(null);
|
|
174
|
+
expect(cast_value_to_type(undefined, "str")).toBe(undefined);
|
|
175
|
+
});
|
|
166
176
|
});
|