You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mapledan (via GitHub)" <gi...@apache.org> on 2026/03/30 11:12:08 UTC
[PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
mapledan opened a new pull request, #38949:
URL: https://github.com/apache/superset/pull/38949
### SUMMARY
#37625 converted `PivotData` from JavaScript to TypeScript and typed `colKey`/`rowKey` as `string[][]`. To satisfy this type constraint, `processRecord` was updated to wrap all record values with `String()` before storing them as keys.
This introduced a regression: temporal columns containing **numeric timestamps** (e.g. `1704067200000`) are now stringified to `"1704067200000"`. When `TableRenderers` passes this string to `TimeFormatter`, the underlying `stringifyTimeInput` calls `new Date("1704067200000")`, which returns `Invalid Date` in all browsers — numeric strings are not a valid `Date` constructor input. D3 time formatters then output `"NaN"` for each date component, causing pivot table column/row headers to display `NaN`.
**Root cause chain:**
processRecord: String(1704067200000) → "1704067200000"
→ TableRenderers: dateFormatterscol
→ stringifyTimeInput: new Date("1704067200000") = Invalid Date
→ D3 formatter: "NaN"
**Fix:**
Extend `stringifyTimeInput` to handle `string` inputs, completing the TypeScript migration that `fc5506e466` started at the data layer but did not propagate to the formatting layer:
- **Numeric-only strings** (e.g. `"1704067200000"`) are converted back to `number`
via `Number()` before `Date` construction, restoring pre-`fc5506e466` behavior.
- **All other strings** (e.g. ISO date strings `"2024-01-01T00:00:00Z"`) are passed
directly to `new Date()`, which handles them correctly in all browsers.
Also update `TimeFormatter`'s type signature (callable interface, constructor, and `format()` method) to include `string`, making the type system consistent with the actual inputs the formatter receives at runtime.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
| Before | After |
|--------|-------|
| Pivot table date headers show `NaN` for temporal columns with numeric timestamps | Dates display correctly |
### TESTING INSTRUCTIONS
1. Create a chart using the **Pivot Table** visualization
2. Add a temporal column (e.g. `__timestamp`) as a **Row** or **Column**
3. Use a data source that returns dates as numeric timestamps
4. Observe that date headers previously showed `NaN` and now display formatted dates correctly
Unit test added to `TimeFormatter.test.ts`:
handles numeric string, treating it as a timestamp
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4331962046
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | d261c1699aaa11141cb2cd3c02fba0272fb1ef34 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69f01bb8c7346e000978827f |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-38949--superset-docs-preview.netlify.app](https://deploy-preview-38949--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-38949--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4154857553
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4154552980
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/38949?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 64.52%. Comparing base ([`d1903af`](https://app.codecov.io/gh/apache/superset/commit/d1903afc69423b22506b2778eed7077b91db56f1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`ad03626`](https://app.codecov.io/gh/apache/superset/commit/ad0362695481f17d861dea264fe1c0e95d064ccd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #38949 +/- ##
=======================================
Coverage 64.52% 64.52%
=======================================
Files 2536 2536
Lines 130778 130782 +4
Branches 30347 30349 +2
=======================================
+ Hits 84380 84384 +4
Misses 44935 44935
Partials 1463 1463
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/38949/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/38949/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.83% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/38949?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #38949:
URL: https://github.com/apache/superset/pull/38949
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38949:
URL: https://github.com/apache/superset/pull/38949#discussion_r3009141915
##########
superset-frontend/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts:
##########
@@ -67,6 +67,11 @@ describe('TimeFormatter', () => {
test('handles number, treating it as a timestamp', () => {
expect(formatter.format(PREVIEW_TIME.getTime())).toEqual('2017');
});
+ test('handles numeric string, treating it as a timestamp', () => {
+ // PivotData.processRecord coerces values with String(), turning numeric
+ // timestamps into strings. 1704067200000 = 2024-01-01T00:00:00.000Z
+ expect(formatter.format('1704067200000')).toEqual('2024');
Review Comment:
**Suggestion:** The new test hardcodes a timestamp representing midnight UTC on Jan 1, 2024, but because `getFullYear()` uses the local timezone, in negative-offset timezones this timestamp falls on Dec 31, 2023 locally, causing the test to intermittently fail depending on the environment; use a timestamp derived from `PREVIEW_TIME` (or another date safely away from year boundaries) so the expected year is stable in all timezones. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ TimeFormatter unit test fails on some developer machines.
- ⚠️ CI may intermittently fail if not forced to UTC.
- ⚠️ Flaky timezone-dependent test reduces trust in test suite.
```
</details>
```suggestion
// timestamps into strings.
const timestamp = PREVIEW_TIME.getTime().toString();
expect(formatter.format(timestamp)).toEqual('2017');
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. On a machine whose local timezone is behind UTC (e.g., America/New_York), run the Jest
test suite that includes
`superset-frontend/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts`.
2. In `.format(value)` tests at `TimeFormatter.test.ts:56-77`, the test `handles numeric
string, treating it as a timestamp` at lines 70-73 calls
`formatter.format('1704067200000')`, with `formatter` created above using `formatFunc:
value => \`\${value.getFullYear()}\``.
3. `TimeFormatter.format` at `src/time-format/TimeFormatter.ts:71-73` delegates to
`stringifyTimeInput` in `src/time-format/utils/stringifyTimeInput.ts:20-33`, which detects
a string input, converts it with `Number(value)`, and creates `new Date(1704067200000)`.
4. In a negative-offset timezone, `new Date(1704067200000)` represents local time late on
2023-12-31, so `getFullYear()` in the test's `formatFunc` returns `2023`, while the test
at `TimeFormatter.test.ts:73` expects `'2024'`, causing the test to fail on such
environments but pass in UTC or positive-offset timezones.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts
**Line:** 72:73
**Comment:**
*Logic Error: The new test hardcodes a timestamp representing midnight UTC on Jan 1, 2024, but because `getFullYear()` uses the local timezone, in negative-offset timezones this timestamp falls on Dec 31, 2023 locally, causing the test to intermittently fail depending on the environment; use a timestamp derived from `PREVIEW_TIME` (or another date safely away from year boundaries) so the expected year is stable in all timezones.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38949&comment_hash=842ac2c96e8bbe1f064486898de370d9c34f0a69e0e59cb991ec31e010dc035c&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38949&comment_hash=842ac2c96e8bbe1f064486898de370d9c34f0a69e0e59cb991ec31e010dc035c&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "mapledan (via GitHub)" <gi...@apache.org>.
mapledan commented on code in PR #38949:
URL: https://github.com/apache/superset/pull/38949#discussion_r3050044221
##########
superset-frontend/packages/superset-ui-core/src/time-format/utils/stringifyTimeInput.ts:
##########
@@ -18,12 +18,17 @@
*/
export default function stringifyTimeInput(
- value: Date | number | undefined | null,
+ value: Date | number | string | undefined | null,
fn: (time: Date) => string,
) {
if (value === null || value === undefined) {
return `${value}`;
}
+ if (typeof value === 'string') {
+ const num = Number(value);
+ return fn(new Date(Number.isFinite(num) ? num : value));
Review Comment:
@rusackas Before addressing the edge cases in the string-handling path, wanted to check your preferred direction: should stringifyTimeInput be made defensively robust to string inputs (given TypeScript coercion can widen types at the PivotData layer), or would you rather keep this function's contract narrow and fix the coercion upstream instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4325515305
Thanks for pinging me on this. I'd lean toward making `stringifyTimeInput` defensively robust to strings — it's the type boundary where runtime values actually arrive (as this regression showed), and the signature already admits `string`, so the contract should match.
I think Copilot's concern is worth addressing: `Number('')` and `Number(' ')` both evaluate to `0`, so the current check would silently render those as the epoch rather than falling through to `new Date(value)` (which would at least produce `Invalid Date`). A digit-only regex is the cleanest fix:
```ts
if (typeof value === 'string') {
const trimmed = value.trim();
const isIntegerString = /^-?\d+$/.test(trimmed);
return fn(new Date(isIntegerString ? Number(trimmed) : value));
}
```
While you're in there, it'd be nice to take Copilot's second suggestion too and add an ISO-8601 test case alongside the numeric-string one — keeps the non-numeric path from silently breaking in a future refactor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4332184670
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #38949:
URL: https://github.com/apache/superset/pull/38949#discussion_r3017400111
##########
superset-frontend/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts:
##########
@@ -67,6 +67,12 @@ describe('TimeFormatter', () => {
test('handles number, treating it as a timestamp', () => {
expect(formatter.format(PREVIEW_TIME.getTime())).toEqual('2017');
});
+ test('handles numeric string, treating it as a timestamp', () => {
+ // PivotData.processRecord coerces values with String(), turning numeric
+ // timestamps into strings.
+ const timestamp = PREVIEW_TIME.getTime().toString();
+ expect(formatter.format(timestamp)).toEqual('2017');
+ });
Review Comment:
The new string-handling path is only tested for numeric strings. Consider adding a test for a non-numeric date string (e.g. ISO 8601) to ensure it still formats correctly and isn’t accidentally coerced via the numeric-detection logic in the future.
```suggestion
});
test('handles non-numeric ISO date string', () => {
const isoString = PREVIEW_TIME.toISOString();
expect(formatter.format(isoString)).toEqual('2017');
});
```
##########
superset-frontend/packages/superset-ui-core/src/time-format/utils/stringifyTimeInput.ts:
##########
@@ -18,12 +18,17 @@
*/
export default function stringifyTimeInput(
- value: Date | number | undefined | null,
+ value: Date | number | string | undefined | null,
fn: (time: Date) => string,
) {
if (value === null || value === undefined) {
return `${value}`;
}
+ if (typeof value === 'string') {
+ const num = Number(value);
+ return fn(new Date(Number.isFinite(num) ? num : value));
Review Comment:
`Number.isFinite(Number(value))` treats some non-timestamp strings as numeric (e.g. `''` or `' '` become `0`, and `'1e3'`/`'0x10'` are also finite), which would unexpectedly format as epoch/other dates. If the intent is to only re-coerce *digit-only* timestamp strings, consider using a stricter check (e.g. trim + regex like `^-?\d+$`) before converting to `number`, and otherwise fall back to `new Date(value)`.
```suggestion
const trimmed = value.trim();
const isIntegerString = /^-?\d+$/.test(trimmed);
if (isIntegerString) {
const num = Number(trimmed);
return fn(new Date(num));
}
return fn(new Date(value));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(time-format): handle string input in TimeFormatter to fix pivot table NaN dates [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38949:
URL: https://github.com/apache/superset/pull/38949#issuecomment-4154184924
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org