question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2compat] wrong param passed when param contains JSON

See original GitHub issue

Environment

  • KFP SDK version: master branch

Steps to reproduce

import kfp
from kfp import dsl
from kfp.components import create_component_from_func


@create_component_from_func
def test(json_param: str):
    print(json_param)


@dsl.pipeline(name='bug-json-param')
def my_pipeline(
    json_param: str = '{"a":"b"}',
    value: str = 'c',
):
    test(json_param).set_display_name('test1')
    test('{"a":"' + f'{value}' + '"}').set_display_name('test2')


if __name__ == '__main__':
    kfp.Client().create_run_from_pipeline_func(
        my_pipeline,
        arguments={},
        mode=dsl.PipelineExecutionMode.V2_COMPATIBLE,
    )

I got the following log for test2 task (task1 is expected).

{\"a\":\"c\"}

Expected result

{"a":"c"}

Materials and Reference


Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Bobgycommented, Jul 4, 2021

Currently FE implements a hack to workaround MLPipeline UI Metadata name conversion, we need to make sure to update frontend to remove the hack, once SDK has made corresponding change:

#5961 (comment)

@zijianjoy we might consider keeping the sanitization in UI permanently, because artifact naming convention changed when going to KFP v2. In v2, we will no longer sanitize artifact names automatically in SDK.

0reactions
zijianjoycommented, Jul 9, 2021

@zijianjoy we might consider keeping the sanitization in UI permanently, because artifact naming convention changed when going to KFP v2. In v2, we will no longer sanitize artifact names automatically in SDK.

I see, thank you for confirming!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RESTful API - Correct behaviour when spurious/not requested ...
We are developing a RESTful api that accepts query parameters in the request in the form of JSON encoded data.
Read more >
Request Parameters and JSON | Revel - A Web Application ...
Bind(target,paramname) , JSON data is always ignored, you can call c.Params.BindJSON(target) to bind the JSON data to the specified object. You must pass...
Read more >
typeerror: expected str, bytes or os.pathlike object - You.com | The ...
So basically, argv returns a list of all the parameters passed in with the name ... The error is happening because the function...
Read more >
oggm.utils._funcs — OGGM 1.5.3 documentation
PARAMS ['rgi_version'] if version in _RGI_METADATA: return ... format(pbs.type)) try: # Shapely v2 compat pbs = pbs.geoms except AttributeError: pass # Out ...
Read more >
Is it a bad idea to pass JSON objects on the query string for an ...
Many servers will log URIs and query string parameters which may leave sensitive data in places you dont want it. For this kind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found