Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ndjson bug #1663

Merged
merged 2 commits into from
May 20, 2021
Merged

Ndjson bug #1663

merged 2 commits into from
May 20, 2021

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented May 19, 2021

fixes #1660

Improve the Record#has method to check for the name and type of a field. Thanks to @mccanne , we can use strict equality to check the types of fields.

For example:

if (record.has("ts", zed.Time) {
  record.get("ts").toDate()
}

It also can check for more than one type by passing in more types:

if (record.has("_path", zed.String, zed.BString)) // ...

I also found some more code in the log detail area that did not get the syntax upgrade in #1645

They have been fixed and I moved the programs to the "programs.ts" file. I hope to have all zed programs localized to this file in case we need to change the syntax again.

Finally, I realized that if we had some integration tests covering the log detail pane, we would not have so many regressions. I plan to add some shortly.

@jameskerr jameskerr requested review from a team and mason-fish May 19, 2021 23:13
@jameskerr jameskerr merged commit db9cf97 into main May 20, 2021
@jameskerr jameskerr deleted the ndjson-bug branch May 20, 2021 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeError: this.r.get(...).toDate is not a function" when opening Log Detail on unshaped NDJSON
2 participants