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

fix: type error on invalid nested json input #693

Merged
merged 35 commits into from
Mar 30, 2023

Conversation

4nalog
Copy link
Member

@4nalog 4nalog commented Mar 1, 2023

TL;DR

This PR fixes the parseJson utility function that maps inputs to a JSON form to handle situations when a nested object is optional or has value of null.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

  • fix: parseJson helper function does not handle null values

Tracking Issue

fixes flyteorg/flyte#3157

Follow-up issue

NA

@4nalog 4nalog changed the title [WIP] fix: type error on invalid nested json input fix: type error on invalid nested json input Mar 2, 2023
@4nalog 4nalog marked this pull request as ready for review March 2, 2023 15:23
@4nalog 4nalog requested a review from jsonporter March 2, 2023 15:23
@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #693 (4f598e9) into master (ca1b5b8) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #693      +/-   ##
==========================================
- Coverage   66.74%   66.73%   -0.02%     
==========================================
  Files         464      464              
  Lines       11388    11390       +2     
  Branches     2102     2104       +2     
==========================================
  Hits         7601     7601              
- Misses       3787     3789       +2     
Impacted Files Coverage Δ
...e/src/components/Launch/LaunchForm/StructInput.tsx 54.34% <0.00%> (-2.48%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

if (keys[0]) {
if (keys.length > 1) {
// If there are multiple keys, we can't render a form because of not supporting nested structs
jsonFormRenderable = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to render a free-form text area in this case; they can paste in JSON?

@4nalog 4nalog force-pushed the soham/fix-type-error-on-invalid-json-input branch from bafe0c7 to 1f3e7db Compare March 30, 2023 18:35
4nalog and others added 24 commits March 30, 2023 14:47
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: launchform

Signed-off-by: James <james@union.ai>

* fix: stuck issue

Signed-off-by: James <james@union.ai>

* fix: on form change

Signed-off-by: James <james@union.ai>

* fix: merge master into branch

Signed-off-by: James <james@union.ai>

---------

Signed-off-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Jason Porter <jason@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: project settings dashbboard tests

Signed-off-by: 4nalog <4nalog@protonmail.com>

* chore: remove .only

Signed-off-by: 4nalog <4nalog@protonmail.com>

* refactor: remove empty waitFor

Signed-off-by: 4nalog <4nalog@protonmail.com>

---------

Signed-off-by: 4nalog <4nalog@protonmail.com>
Upgrading node version to 18

Signed-off-by: Jason Porter <jason@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: revert node version

Signed-off-by: Carina Ursu <carina@union.ai>

* Revert "fix: upgrading node version to 18 (#703)"

This reverts commit e5f9a8b.

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: deployment optimization

Signed-off-by: Carina Ursu <carina@union.ai>

* clean up node modules and one file that we think is not needed

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Co-authored-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: fix update_npmversion

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: edits

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: cache status logs indexing mismatch and react rendering cycle issue

Signed-off-by: James <james@union.ai>

* fix: mapped task cache status

Signed-off-by: James <james@union.ai>

---------

Signed-off-by: James <james@union.ai>
Co-authored-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
fix: passthrough runtime variables

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
fix: nodejs 18 upgrade

Signed-off-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: allow complex workflow names

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: fix buold:watch

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: yarn.lock

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: upgrade package

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
* chore: show correct app version in info

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: update ver

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
fix: add icon for put failure

Signed-off-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: add material-ui class name seed

Signed-off-by: Carina Ursu <carina@union.ai>

* fix: overflow of modal

Signed-off-by: James <james@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: James <james@union.ai>
Co-authored-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
… correctly (#723)

fix: dynamic nodes status

Signed-off-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
ursucarina and others added 10 commits March 30, 2023 14:48
* chore: backfill index on execution task logs

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: add comments

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: bump version

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: remove backfill

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: lint

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: eduardo apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: eduardo apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: show correct i/o in details panel

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: bump version

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: feedback

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: tlro basic setup

Signed-off-by: Carina Ursu <carina@union.ai>

* progress checkin

* Stable state refactored to use generic naming

* updated types

* working before updating routes

* chore: progress

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: remove debugger

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: allow custom class in execution actions

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: lint fix

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: bump console

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: up package version

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Co-authored-by: Jason Porter <jason@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* chore: fix contextual menu action buttons color

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: up console version

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: approveCondition reject

Signed-off-by: James <james@union.ai>

* fix: approve button

Signed-off-by: James <james@union.ai>

---------

Signed-off-by: James <james@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
* fix: gate node in dynamic

Signed-off-by: James <james@union.ai>

* fix: upgraded version

Signed-off-by: James <james@union.ai>

* fix: compiledNode in PausedTasksComponent and ExecutionDetailsActions

Signed-off-by: James <james@union.ai>

* fix: upgrade version

Signed-off-by: James <james@union.ai>

* chore: lockfile

Signed-off-by: Carina Ursu <carina@union.ai>

* fix: remove caching for workflow closure

Signed-off-by: James <james@union.ai>

* fix: break link between cache and context state

Signed-off-by: James <james@union.ai>

---------

Signed-off-by: James <james@union.ai>
Signed-off-by: Carina Ursu <carina@union.ai>
Co-authored-by: Carina Ursu <carina@union.ai>
Signed-off-by: 4nalog <4nalog@protonmail.com>
Signed-off-by: 4nalog <4nalog@protonmail.com>
@4nalog 4nalog force-pushed the soham/fix-type-error-on-invalid-json-input branch from 7a9577b to 9423239 Compare March 30, 2023 18:48
@4nalog 4nalog requested a review from jsonporter March 30, 2023 18:49
@jsonporter jsonporter merged commit c82e755 into master Mar 30, 2023
@jsonporter jsonporter deleted the soham/fix-type-error-on-invalid-json-input branch March 30, 2023 20:21
@flyte-bot
Copy link
Collaborator

🎉 This PR is included in version 1.5.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] TypeError: can't convert null to object if using wrong default in dataclass
6 participants