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
* fix: launchform

Signed-off-by: James <[email protected]>

* fix: stuck issue

Signed-off-by: James <[email protected]>

* fix: on form change

Signed-off-by: James <[email protected]>

* fix: merge master into branch

Signed-off-by: James <[email protected]>

---------

Signed-off-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: Jason Porter <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: project settings dashbboard tests

Signed-off-by: 4nalog <[email protected]>

* chore: remove .only

Signed-off-by: 4nalog <[email protected]>

* refactor: remove empty waitFor

Signed-off-by: 4nalog <[email protected]>

---------

Signed-off-by: 4nalog <[email protected]>
Upgrading node version to 18

Signed-off-by: Jason Porter <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: revert node version

Signed-off-by: Carina Ursu <[email protected]>

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

This reverts commit e5f9a8b.

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: deployment optimization

Signed-off-by: Carina Ursu <[email protected]>

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

Signed-off-by: Yee Hing Tong <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Co-authored-by: Yee Hing Tong <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: fix update_npmversion

Signed-off-by: Carina Ursu <[email protected]>

* chore: edits

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: cache status logs indexing mismatch and react rendering cycle issue

Signed-off-by: James <[email protected]>

* fix: mapped task cache status

Signed-off-by: James <[email protected]>

---------

Signed-off-by: James <[email protected]>
Co-authored-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
fix: passthrough runtime variables

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
fix: nodejs 18 upgrade

Signed-off-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: allow complex workflow names

Signed-off-by: Carina Ursu <[email protected]>

* chore: fix buold:watch

Signed-off-by: Carina Ursu <[email protected]>

* chore: yarn.lock

Signed-off-by: Carina Ursu <[email protected]>

* chore: upgrade package

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
* chore: show correct app version in info

Signed-off-by: Carina Ursu <[email protected]>

* chore: update ver

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
fix: add icon for put failure

Signed-off-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: add material-ui class name seed

Signed-off-by: Carina Ursu <[email protected]>

* fix: overflow of modal

Signed-off-by: James <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: James <[email protected]>
Co-authored-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
… correctly (#723)

fix: dynamic nodes status

Signed-off-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
ursucarina and others added 10 commits March 30, 2023 14:48
* chore: backfill index on execution task logs

Signed-off-by: Carina Ursu <[email protected]>

* chore: add comments

Signed-off-by: Carina Ursu <[email protected]>

* chore: bump version

Signed-off-by: Carina Ursu <[email protected]>

* chore: remove backfill

Signed-off-by: Carina Ursu <[email protected]>

* chore: lint

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: eduardo apolinario <[email protected]>
Co-authored-by: eduardo apolinario <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: show correct i/o in details panel

Signed-off-by: Carina Ursu <[email protected]>

* chore: bump version

Signed-off-by: Carina Ursu <[email protected]>

* chore: feedback

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: tlro basic setup

Signed-off-by: Carina Ursu <[email protected]>

* progress checkin

* Stable state refactored to use generic naming

* updated types

* working before updating routes

* chore: progress

Signed-off-by: Carina Ursu <[email protected]>

* chore: remove debugger

Signed-off-by: Carina Ursu <[email protected]>

* chore: allow custom class in execution actions

Signed-off-by: Carina Ursu <[email protected]>

* chore: lint fix

Signed-off-by: Carina Ursu <[email protected]>

* chore: bump console

Signed-off-by: Carina Ursu <[email protected]>

* chore: up package version

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Co-authored-by: Jason Porter <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* chore: fix contextual menu action buttons color

Signed-off-by: Carina Ursu <[email protected]>

* chore: up console version

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: approveCondition reject

Signed-off-by: James <[email protected]>

* fix: approve button

Signed-off-by: James <[email protected]>

---------

Signed-off-by: James <[email protected]>
Signed-off-by: 4nalog <[email protected]>
* fix: gate node in dynamic

Signed-off-by: James <[email protected]>

* fix: upgraded version

Signed-off-by: James <[email protected]>

* fix: compiledNode in PausedTasksComponent and ExecutionDetailsActions

Signed-off-by: James <[email protected]>

* fix: upgrade version

Signed-off-by: James <[email protected]>

* chore: lockfile

Signed-off-by: Carina Ursu <[email protected]>

* fix: remove caching for workflow closure

Signed-off-by: James <[email protected]>

* fix: break link between cache and context state

Signed-off-by: James <[email protected]>

---------

Signed-off-by: James <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Co-authored-by: Carina Ursu <[email protected]>
Signed-off-by: 4nalog <[email protected]>
Signed-off-by: 4nalog <[email protected]>
@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