Skip to content

Commit e166969

Browse files
Merge pull request #2653 from dhruvesh09/r0.24.0
Fix issue where invalid artifact proto could be passed to MLMD and TFX 0.24.1 Patch Release
2 parents b691341 + 4d0d61c commit e166969

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ but other *untested* combinations may also work.
6262
tfx | apache-beam[gcp] | ml-metadata | pyarrow | tensorflow | tensorflow-data-validation | tensorflow-metadata | tensorflow-model-analysis | tensorflow-transform | tfx-bsl |
6363
------------------------------------------------------------------------- | ---------------- | ----------- | --------| ----------------- | -------------------------- | ------------------- | ------------------------- | -------------------- | ------- |
6464
[GitHub master](https://github.com/tensorflow/tfx/blob/master/RELEASE.md) | 2.24.0 | 0.24.0 | 0.17.0 | nightly (1.x/2.x) | 0.24.1 | 0.24.0 | 0.24.3 | 0.24.1 | 0.24.1 |
65+
0.24.1 | 2.24.0 | 0.24.0 | 0.17.0 | 1.15.0 / 2.3.0 | 0.24.1 | 0.24.0 | 0.24.3 | 0.24.1 | 0.24.1 |
6566
0.24.0 | 2.24.0 | 0.24.0 | 0.17.0 | 1.15.0 / 2.3.0 | 0.24.1 | 0.24.0 | 0.24.3 | 0.24.1 | 0.24.1 |
6667
0.23.0 | 2.23.0 | 0.23.0 | 0.17.0 | 1.15.0 / 2.3.0 | 0.23.0 | 0.23.0 | 0.23.0 | 0.23.0 | 0.23.0 |
6768
0.22.1 | 2.21.0 | 0.22.1 | 0.16.0 | 1.15.0 / 2.2.0 | 0.22.2 | 0.22.2 | 0.22.2 | 0.22.0 | 0.22.1 |

RELEASE.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
# Version 0.24.0
1+
# Version 0.24.1
22

33
## Major Features and Improvements
44

5-
* Use TFXIO and batched extractors by default in Evaluator.
6-
* Supported custom split configuration for ExampleGen and its downstream
7-
components. Instead of hardcoded 'train' and 'eval' splits, TFX components
8-
now can process the custom splits generated by ExampleGen. For details,
9-
please refer to [ExampleGen doc](https://github.com/tensorflow/tfx/blob/r0.24.0/docs/guide/examplegen.md#custom-examplegen)
10-
* Added python 3.8 support.
5+
* N/A
116

127
## Bug fixes and other changes
138

14-
* Supported CAIP Runtime 2.2 for online prediction pusher.
15-
* Used 'python -m ' style for container entrypoints.
16-
* Stopped depending on `google-resumable-media`.
17-
* Stopped depending on `Werkzeug`.
18-
* Depends on `absl-py>=0.9,<0.11`.
19-
* Depends on `apache-beam[gcp]>=2.24,<3`.
20-
* Depends on `ml-metadata>=0.24,<0.25`.
21-
* Depends on `protobuf>=3.12.2,<4`.
22-
* Depends on `tensorflow-data-validation>=0.24.1,<0.25`.
23-
* Depends on `tensorflow-model-analysis>=0.24.3,<0.25`.
24-
* Depends on `tensorflow-transform>=0.24.1,<0.25`.
25-
* Depends on `tfx-bsl>=0.24.1,<0.25`.
9+
* Fixes issues where custom property access of a missing property created an invalid MLMD Artifact protobuf message.
2610

2711
## Breaking changes
2812

@@ -42,4 +26,4 @@
4226

4327
## Deprecations
4428

45-
* Deprecated python 3.5 support.
29+
* N/A

tfx/types/artifact.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,14 @@ def set_int_custom_property(self, key: Text, value: int):
465465

466466
def get_string_custom_property(self, key: Text) -> Text:
467467
"""Get a custom property of string type."""
468+
if key not in self._artifact.custom_properties:
469+
return ''
468470
return self._artifact.custom_properties[key].string_value
469471

470472
def get_int_custom_property(self, key: Text) -> int:
471473
"""Get a custom property of int type."""
474+
if key not in self._artifact.custom_properties:
475+
return 0
472476
return self._artifact.custom_properties[key].int_value
473477

474478
def copy_from(self, other: 'Artifact'):

tfx/types/artifact_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ def testArtifactTypeFunctionAndProto(self):
237237
self.assertEqual(my_artifact.float2, 222.2)
238238
self.assertEqual(my_artifact.string1, '111')
239239
self.assertEqual(my_artifact.string2, '222')
240+
self.assertEqual(my_artifact.get_string_custom_property('invalid'), '')
241+
self.assertEqual(my_artifact.get_int_custom_property('invalid'), 0)
242+
self.assertNotIn('invalid', my_artifact._artifact.custom_properties)
240243

241244
def testInvalidArtifact(self):
242245
with self.assertRaisesRegexp(

tfx/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"""Contains the version string of TFX."""
1616

1717
# Note that setup.py uses this version.
18-
__version__ = '0.24.0'
18+
__version__ = '0.24.1'

0 commit comments

Comments
 (0)