internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: kubeflow/pipelines

Issue:
TypeErro occurs in gcp/automl/create_dataset_for_tables component
### What steps did you take:
[A clear and concise description of what the bug is.]

[gcp/automl/create_dataset_for_tables component](https://github.com/kubeflow/pipelines/tree/master/components/gcp/automl/create_dataset_for_tables)'s `create_time` output is declared as a string:

https://github.com/kubeflow/pipelines/blob/ecb14f40bb819c0678589b6458892ece5369fa71/components/gcp/automl/create_dataset_for_tables/component.yaml#L15

however, `google.protobuf.timestamp_pb2.Timestamp` is returned in actual fact:

https://github.com/kubeflow/pipelines/blob/ecb14f40bb819c0678589b6458892ece5369fa71/components/gcp/automl/create_dataset_for_tables/component.py#L54

FYI: The `dataset` object is an instance of `google.cloud.automl_v1beta1.types.Dataset` class and its [document](https://googleapis.dev/python/automl/0.4.0/gapic/v1beta1/types.html#google.cloud.automl_v1beta1.types.Dataset.create_time) says:

> **create_time**
> Output only. Timestamp when this dataset was created.

### What happened:

`TypeError` occurs

![image](https://user-images.githubusercontent.com/96157/106237273-cf955a00-6241-11eb-91e2-2c53e4e82623.png)

### What did you expect to happen:

Work.

### Environment:
<!-- Please fill in those that seem relevant. -->

How did you deploy Kubeflow Pipelines (KFP)? AI Platform Pipelines
<!-- If you are not sure, here's [an introduction of all options](https://www.kubeflow.org/docs/pipelines/installation/overview/). -->

KFP version: 1.0.4 <!-- If you are not sure, build commit shows on bottom of KFP UI left sidenav. -->

KFP SDK version: 1.3.0 <!-- Please attach the output of this shell command: $pip list | grep kfp -->


### Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

/kind bug
<!-- Please include labels by uncommenting them to help us better triage issues, choose from the following -->
<!--
// /area frontend
// /area backend
// /area sdk
// /area testing
// /area engprod
-->



Discussion:

Resolving patch:
diff --git a/components/gcp/automl/create_dataset_for_tables/component.py b/components/gcp/automl/create_dataset_for_tables/component.py
--- a/components/gcp/automl/create_dataset_for_tables/component.py
+++ b/components/gcp/automl/create_dataset_for_tables/component.py
@@ -51,7 +51,7 @@ def automl_create_dataset_for_tables(
         region=gcp_region,
         dataset_id=dataset_id,
     )
-    return (dataset.name, dataset.create_time, dataset_id, dataset_url)
+    return (dataset.name, str(dataset.create_time), dataset_id, dataset_url)
 
 
 if __name__ == '__main__':


Test patch:
Repository: kubeflow/pipelines

Issue:
Presubmit failure
If you look into the test it said
```
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/local/lib/python3.6/site-packages/kfp/__init__.py", line 24, in <module>
    from ._client import Client
  File "/usr/local/lib/python3.6/site-packages/kfp/_client.py", line 31, in <module>
    from kfp.compiler import compiler
  File "/usr/local/lib/python3.6/site-packages/kfp/compiler/__init__.py", line 17, in <module>
    from ..containers._component_builder import build_python_component, build_docker_image, VersionedDependency
  File "/usr/local/lib/python3.6/site-packages/kfp/containers/_component_builder.py", line 32, in <module>
    from kfp.containers import entrypoint
  File "/usr/local/lib/python3.6/site-packages/kfp/containers/entrypoint.py", line 23, in <module>
    from kfp.containers import entrypoint_utils
  File "/usr/local/lib/python3.6/site-packages/kfp/containers/entrypoint_utils.py", line 23, in <module>
    from kfp.pipeline_spec import pipeline_spec_pb2
  File "/usr/local/lib/python3.6/site-packages/kfp/pipeline_spec/pipeline_spec_pb2.py", line 23, in <module>
    create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'
```

Looks like the `protobuf` version is not matching in this case. @Bobgy are you aware of this error? Thanks.

_Originally posted by @Tomcli in https://github.com/kubeflow/pipelines/pull/5059#issuecomment-777656530_

/cc @numerology @chensun @Ark-kun 
Can you take a look at this issue? I have seen multiple reports, this error seems to fail consistently.


Discussion:

Resolving patch:
diff --git a/api/v2alpha1/python/setup.py b/api/v2alpha1/python/setup.py
--- a/api/v2alpha1/python/setup.py
+++ b/api/v2alpha1/python/setup.py
@@ -84,6 +84,7 @@ def GenerateProto(source):
     url="https://github.com/kubeflow/pipelines",
     packages=setuptools.find_namespace_packages(include=['kfp.*']),
     python_requires=">=3.5.3",
+    install_requires=["protobuf>=3.13.0,<4"],
     include_package_data=True,
     license="Apache 2.0",
 )


Test patch:
Repository: kubeflow/pipelines

Issue:
Problems upgrading to TFX 0.27.0
### What steps did you take:
Installed Kubeflow Pipelines on GCP via kustomize manifests.
Tried to run the Taxi TFX Demo.

### What happened:
On the first step, I got the error "No module named 'tfx.dsl.components'"

### What did you expect to happen:
To successfully run the TFX Taxi Demo.

### Environment:
How did you deploy Kubeflow Pipelines (KFP)?
Via the kustomize manifests in GCP.

KFP version: 1.4.0-rc.1

/kind bug
/area backend


Discussion:
@rafaascensao Which version of TFX are you using? the tfx.dsl package was introduced in TFX 0.25.0 I think, and if you are using an older version this error would pop up. Try running updating TFX to latest by running `python3 -m pip install -U tfx`. Anyway, this is a package import issue and most likely has nothing to do with KFP.
@ConverJens I am talking about the sample pipeline of TFX Taxi that comes with the deployment (https://github.com/kubeflow/pipelines/blob/master/samples/core/parameterized_tfx_oss/parameterized_tfx_oss.py). If I see the code, it uses a TFX image with the version 0.22.0. 
@rafaascensao Sorry! In that case, the image needs to be updated to tfx>=0.25.0. Ping @Bobgy, do you know who maintains this?
/assign @numerology @chensun @neuromage 

This seems a P0.

Resolving patch:
diff --git a/samples/core/parameterized_tfx_oss/parameterized_tfx_oss.py b/samples/core/parameterized_tfx_oss/parameterized_tfx_oss.py
--- a/samples/core/parameterized_tfx_oss/parameterized_tfx_oss.py
+++ b/samples/core/parameterized_tfx_oss/parameterized_tfx_oss.py
@@ -39,7 +39,7 @@
 # or a module file baked in the docker image used by the pipeline.
 _taxi_module_file_param = data_types.RuntimeParameter(
     name='module-file',
-    default='/tfx-src/tfx/examples/chicago_taxi_pipeline/taxi_utils.py',
+    default='/tfx/src/tfx/examples/chicago_taxi_pipeline/taxi_utils.py',
     ptype=Text,
 )
 
@@ -178,7 +178,7 @@ def _create_pipeline(
   config = kubeflow_dag_runner.KubeflowDagRunnerConfig(
       kubeflow_metadata_config=kubeflow_dag_runner.
       get_default_kubeflow_metadata_config(),
-      tfx_image='gcr.io/tfx-oss-public/tfx:0.22.0',
+      tfx_image='gcr.io/tfx-oss-public/tfx:0.27.0',
   )
   kfp_runner = kubeflow_dag_runner.KubeflowDagRunner(
       output_filename=__file__ + '.yaml', config=config


Test patch:
Repository: kubeflow/pipelines

Issue:
[Bug] KeyValueStore fails to check the cached data with new data
Typo bug.

```
def store_value_bytes(self, key: str, data: bytes) -> str:
    ... 
     if cache_value_file_path.exists():
        old_data = cache_value_file_path.write_bytes()
    ...    
```
should be:
```
def store_value_bytes(self, key: str, data: bytes) -> str:
    ... 
     if cache_value_file_path.exists():
        old_data = cache_value_file_path.read_bytes()
    ...    
```


Discussion:
cc @Ark-kun 

Resolving patch:
diff --git a/sdk/python/kfp/components/_key_value_store.py b/sdk/python/kfp/components/_key_value_store.py
--- a/sdk/python/kfp/components/_key_value_store.py
+++ b/sdk/python/kfp/components/_key_value_store.py
@@ -31,7 +31,7 @@ def store_value_bytes(self, key: str, data: bytes) -> str:
                     '"{}" != new key "{}"'.format(cache_key_file_path, old_key, key)
                 )
             if cache_value_file_path.exists():
-                old_data = cache_value_file_path.write_bytes()
+                old_data = cache_value_file_path.read_bytes()
                 if data != old_data:
                     # TODO: Add options to raise error when overwriting the value.
                     pass


Test patch:
Repository: kubeflow/pipelines

Issue:
sdk/client/auth - KeyError: 'id_token' from _auth.py in id_token_from_refresh_token
If getting “KeyError: 'id_token'” from “File "/Users/gongyuan/miniconda3/envs/mlpipeline/lib/python3.7/site-packages/kfp/_auth.py", line 192, in id_token_from_refresh_token
    return (str(json.loads(res.text)[u"id_token"]))

The request to get id token from refresh token failed, but the client didn’t surface the underlying error message. The http response I got was
```
{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}
```

And root cause: ~/.config/kfp/credentials.json has expired. I deleted it and got a new token: `rm ~/.config/kfp/credentials.json`.

## Solution

https://github.com/kubeflow/pipelines/blob/2a65eec1fa265ebbda69d5b8b1875e3e4b54ac82/sdk/python/kfp/_auth.py#L184-L185 and https://github.com/kubeflow/pipelines/blob/2a65eec1fa265ebbda69d5b8b1875e3e4b54ac82/sdk/python/kfp/_auth.py#L191-L192, we should first check request response status code by `Response.raise_for_exception`, it could be `401 unauthorized`.


Discussion:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

/lifecycle frozen
/cc @chensun 
Picking this up. Let me know if there is any problem in working on this issue. thanks! 

Resolving patch:
diff --git a/sdk/python/kfp/_auth.py b/sdk/python/kfp/_auth.py
--- a/sdk/python/kfp/_auth.py
+++ b/sdk/python/kfp/_auth.py
@@ -180,15 +180,19 @@ def get_auth_code(client_id):
     open_new_tab(auth_url)
     return input("If there's no browser window prompt, please direct to the URL above, then copy and paste the authorization code here: ")
 
+
 def get_refresh_token_from_code(auth_code, client_id, client_secret):
     payload = {"code": auth_code, "client_id": client_id, "client_secret": client_secret,
                "redirect_uri": "urn:ietf:wg:oauth:2.0:oob", "grant_type": "authorization_code"}
     res = requests.post(OAUTH_TOKEN_URI, data=payload)
-    return (str(json.loads(res.text)[u"refresh_token"]))
+    res.raise_for_status()
+    return str(json.loads(res.text)[u"refresh_token"])
+
 
 def id_token_from_refresh_token(client_id, client_secret, refresh_token, audience):
     payload = {"client_id": client_id, "client_secret": client_secret,
                "refresh_token": refresh_token, "grant_type": "refresh_token",
                "audience": audience}
     res = requests.post(OAUTH_TOKEN_URI, data=payload)
-    return (str(json.loads(res.text)[u"id_token"]))
+    res.raise_for_status()
+    return str(json.loads(res.text)[u"id_token"])


Test patch:
Repository: kubeflow/pipelines

Issue:
[feature] Automatically json serialize pipeline run arguments that are of type list or dict
### Feature Area

 /area sdk 


### What feature would you like to see?
This feature concerns having list/dict inputs to pipelines when running them with the SDK. Right now, when starting runs with the python SDK, one must manually serialize lists to json, otherwise it will get falsely serialized and it can't be passed to components properly.

It would be nice if the `arguments` input to `client.create_run_from_pipeline_func` or the `params` input to `run_pipeline` could automatically json serialize values whos type is list/dict

### What is the use case or pain point?
The pain point is that this is a hard issue to track down, and it's unintuitive to have list/dict inputs to pipelines and running them from a python script

### Is there a workaround currently?

The current workaround is to manually use `json.dumps()` on any lists in the input argument to the run

---

<!-- Don't delete message below to encourage users to support your feature request! -->
Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.



Discussion:
Agree the feature would be a nice to have!
Welcome contribution on this

Resolving patch:
diff --git a/sdk/python/kfp/_client.py b/sdk/python/kfp/_client.py
--- a/sdk/python/kfp/_client.py
+++ b/sdk/python/kfp/_client.py
@@ -707,7 +707,7 @@ def __init__(self, spec, resource_references):
       pipeline_json_string = json.dumps(pipeline_obj)
     api_params = [kfp_server_api.ApiParameter(
         name=sanitize_k8s_name(name=k, allow_capital_underscore=True),
-        value=str(v)) for k,v in params.items()]
+        value=str(v) if type(v) not in (list, dict) else json.dumps(v)) for k,v in params.items()]
     resource_references = []
     key = kfp_server_api.models.ApiResourceKey(id=experiment_id,
                                         type=kfp_server_api.models.ApiResourceType.EXPERIMENT)


Test patch:
Repository: kubeflow/pipelines

Issue:
[sdk] v2compat - pipeline without name also runs
### Environment

*  KFP SDK version: master
<!-- Specify the version of Kubeflow Pipelines that you are using. The version number appears in the left side navigation of user interface.
To find the version number, See version number shows on bottom of KFP UI left sidenav. -->


### Steps to reproduce

1. Run a pipeline function, but do not annotate the pipeline decorator

```
def abc():
    xxxxx
```

2. Verify the pipeline runs properly in v2 compatible mode

3. However, if we look at the pipeline's pipeline name, it is empty -- "pipeline/".
<!--
Specify how to reproduce the problem. 
This may include information such as: a description of the process, code snippets, log output, or screenshots.
-->

### Expected result

<!-- What should the correct behavior be? -->
The pipeline should fail without a pipeline name, or we may default to the function's name.

### Materials and Reference

<!-- Help us debug this issue by providing resources such as: sample code, background context, or links to references. -->

---

<!-- Don't delete message below to encourage users to support your issue! -->
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.



Discussion:

Resolving patch:
diff --git a/samples/core/XGBoost/xgboost_sample.py b/samples/core/XGBoost/xgboost_sample.py
--- a/samples/core/XGBoost/xgboost_sample.py
+++ b/samples/core/XGBoost/xgboost_sample.py
@@ -9,7 +9,7 @@
 xgboost_train_on_parquet_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/0ae2f30ff24beeef1c64cc7c434f1f652c065192/components/XGBoost/Train/from_ApacheParquet/component.yaml')
 xgboost_predict_on_parquet_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/31939086d66d633732f75300ce69eb60e9fb0269/components/XGBoost/Predict/from_ApacheParquet/component.yaml')
 
-
+@kfp.dsl.pipeline(name='xgboost')
 def xgboost_pipeline():
     training_data_csv = chicago_taxi_dataset_op(
         where='trip_start_timestamp >= "2019-01-01" AND trip_start_timestamp < "2019-02-01"',
diff --git a/sdk/python/kfp/compiler/compiler.py b/sdk/python/kfp/compiler/compiler.py
--- a/sdk/python/kfp/compiler/compiler.py
+++ b/sdk/python/kfp/compiler/compiler.py
@@ -1034,6 +1034,8 @@ def compile(self,
 
     if self._mode == dsl.PipelineExecutionMode.V2_COMPATIBLE:
       pipeline_name = getattr(pipeline_func, '_component_human_name', '')
+      if not pipeline_name:
+        raise ValueError('@dsl.pipeline decorator name field is required in v2 compatible mode')
       # pipeline names have one of the following formats:
       # * pipeline/<name>
       # * namespace/<ns>/pipeline/<name>


Test patch:
Repository: kubeflow/pipelines

Issue:
SDK - Components - Warn when container component does not specify `command`



Discussion:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cc @Bobgy 

Resolving patch:
diff --git a/sdk/python/kfp/components/_components.py b/sdk/python/kfp/components/_components.py
--- a/sdk/python/kfp/components/_components.py
+++ b/sdk/python/kfp/components/_components.py
@@ -23,6 +23,8 @@
 from collections import OrderedDict
 import pathlib
 from typing import Any, Callable, List, Mapping, NamedTuple, Sequence, Union
+import warnings
+
 from ._naming import _sanitize_file_name, _sanitize_python_function_name, generate_unique_name_conversion_table
 from ._yaml_utils import load_yaml
 from .structures import *
@@ -163,6 +165,17 @@ def _load_component_spec_from_component_text(text) -> ComponentSpec:
     component_dict = load_yaml(text)
     component_spec = ComponentSpec.from_dict(component_dict)
 
+    if isinstance(component_spec.implementation, ContainerImplementation) and (
+        component_spec.implementation.container.command is None):
+        warnings.warn(
+            'Container component must specify command to be compatible with KFP '
+            'v2 compatible mode and emissary executor, which will be the default'
+            ' executor for KFP v2.'
+            'https://www.kubeflow.org/docs/components/pipelines/installation/choose-executor/',
+            category=FutureWarning,
+        )
+
+
     # Calculating hash digest for the component
     import hashlib
     data = text if isinstance(text, bytes) else text.encode('utf-8')


Test patch:
diff --git a/sdk/python/kfp/components_tests/test_components.py b/sdk/python/kfp/components_tests/test_components.py
--- a/sdk/python/kfp/components_tests/test_components.py
+++ b/sdk/python/kfp/components_tests/test_components.py
@@ -1043,6 +1043,21 @@ def test_fail_type_compatibility_check_for_types_with_different_schemas(self):
         with self.assertRaises(TypeError):
             b_task = task_factory_b(in1=a_task.outputs['out1'])
 
+    def test_container_component_without_command_should_warn(self):
+        component_a = '''\
+name: component without command
+inputs:
+  - {name: in1, type: String}
+implementation:
+  container:
+    image: busybox
+'''
+
+        with self.assertWarnsRegex(
+            FutureWarning,
+            'Container component must specify command to be compatible with '
+            'KFP v2 compatible mode and emissary executor'):
+            task_factory_a = comp.load_component_from_text(component_a)
 
 if __name__ == '__main__':
     unittest.main()
Repository: kubeflow/pipelines

Issue:
[sdk] dependency conflict with tensorflow 2.6.0 and seldon-core
### Environment

*  KFP version: 1.7
*  KFP SDK version: 1.8.3


*  All dependencies version:
```
[~]$ pip list | grep kfp
kfp                               1.8.3
kfp-pipeline-spec                 0.1.11
kfp-server-api                    1.7.0
```
kfp==1.8.3 collides with tensorflow==2.6 because it requires 

https://github.com/kubeflow/pipelines/blob/220d79df66e31bbd93c409fb361e0463bde4aeac/sdk/python/setup.py#L56

while tensorflow needs
```
Warning!!! Possibly conflicting dependencies found:
* tensorflow==2.6.0
 - typing-extensions [required: ~=3.7.4, installed: 3.10.0.2]
```

https://github.com/tensorflow/tensorflow/blob/421fba8888bb8f8724bc2e35ca2fdcde16e1bfe5/tensorflow/tools/pip_package/setup.py#L90

is `'typing-extensions>=3.7.4,<4;python_version<"3.9"'`   not enough?

The same goes for seldon-core==1.11.* and package click and absl-py

```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
kfp 1.8.2 requires absl-py<=0.11,>=0.9, but you have absl-py 0.13.0 which is incompatible.
kfp 1.8.2 requires click<8,>=7.1.1, but you have click 8.0.1 which is incompatible.
kfp 1.8.2 requires typing-extensions<4,>=3.10.0.2, but you have typing-extensions 3.7.4.3 which is incompatible.
```


Discussion:

Resolving patch:
diff --git a/sdk/python/setup.py b/sdk/python/setup.py
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -51,10 +51,10 @@
     'fire>=0.3.1,<1',
     'protobuf>=3.13.0,<4',
     'uritemplate>=3.0.1,<4',
+    'pydantic>=1.8.2,<2',
     # Standard library backports
     'dataclasses;python_version<"3.7"',
-    'typing-extensions>=3.10.0.2,<4;python_version<"3.9"',
-    'pydantic>=1.8.2,<2',
+    'typing-extensions>=3.7.4,<4;python_version<"3.9"',
 ]
 
 TESTS_REQUIRE = [


Test patch:
Repository: kubeflow/pipelines

Issue:
[sdk] dependency conflict with tensorflow 2.6.0 and seldon-core
### Environment

*  KFP version: 1.7
*  KFP SDK version: 1.8.3


*  All dependencies version:
```
[~]$ pip list | grep kfp
kfp                               1.8.3
kfp-pipeline-spec                 0.1.11
kfp-server-api                    1.7.0
```
kfp==1.8.3 collides with tensorflow==2.6 because it requires 

https://github.com/kubeflow/pipelines/blob/220d79df66e31bbd93c409fb361e0463bde4aeac/sdk/python/setup.py#L56

while tensorflow needs
```
Warning!!! Possibly conflicting dependencies found:
* tensorflow==2.6.0
 - typing-extensions [required: ~=3.7.4, installed: 3.10.0.2]
```

https://github.com/tensorflow/tensorflow/blob/421fba8888bb8f8724bc2e35ca2fdcde16e1bfe5/tensorflow/tools/pip_package/setup.py#L90

is `'typing-extensions>=3.7.4,<4;python_version<"3.9"'`   not enough?

The same goes for seldon-core==1.11.* and package click and absl-py

```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
kfp 1.8.2 requires absl-py<=0.11,>=0.9, but you have absl-py 0.13.0 which is incompatible.
kfp 1.8.2 requires click<8,>=7.1.1, but you have click 8.0.1 which is incompatible.
kfp 1.8.2 requires typing-extensions<4,>=3.10.0.2, but you have typing-extensions 3.7.4.3 which is incompatible.
```


Discussion:
@chensun click<9,>=7.1.1 works for me with kfp and seldon-core
Please reopen, i can still see 
https://github.com/kubeflow/pipelines/blob/7b4f28379d4204da3ad38ce376d2157cc3454356/sdk/python/requirements.txt#L22

and 

https://github.com/kubeflow/pipelines/blob/7b4f28379d4204da3ad38ce376d2157cc3454356/sdk/python/requirements.in#L29

Resolving patch:
diff --git a/sdk/python/setup.py b/sdk/python/setup.py
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -43,7 +43,7 @@
     'kfp-server-api>=1.1.2,<2.0.0',
     'jsonschema>=3.0.1,<4',
     'tabulate>=0.8.6,<1',
-    'click>=7.1.1,<8',
+    'click>=7.1.2,<9',
     'Deprecated>=1.2.7,<2',
     'strip-hints>=0.1.8,<1',
     'docstring-parser>=0.7.3,<1',


Test patch: