From 24913cd0d9fd26cbb3267783cb84dddfa0f1097b Mon Sep 17 00:00:00 2001 From: Konstantin Sozinov Date: Tue, 27 Aug 2019 16:24:36 +0200 Subject: [PATCH] Fix python3 dataflow naming (#214) --- spotify_tensorflow/luigi/python_dataflow_task.py | 2 +- spotify_tensorflow/tfx/tfdv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spotify_tensorflow/luigi/python_dataflow_task.py b/spotify_tensorflow/luigi/python_dataflow_task.py index 31461c0..3eb023d 100644 --- a/spotify_tensorflow/luigi/python_dataflow_task.py +++ b/spotify_tensorflow/luigi/python_dataflow_task.py @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs): # job_name must consist of only the characters [-a-z0-9] cls_name = self.__class__.__name__.replace("_", "-").lower() self.job_name = "{cls_name}-{timestamp}".format(cls_name=cls_name, - timestamp=str(time.time())[:-3]) + timestamp=str(int(time.time()))) def on_successful_run(self): """ Callback that gets called right after the dataflow job has finished successfully but diff --git a/spotify_tensorflow/tfx/tfdv.py b/spotify_tensorflow/tfx/tfdv.py index fd564d9..7f5c387 100644 --- a/spotify_tensorflow/tfx/tfdv.py +++ b/spotify_tensorflow/tfx/tfdv.py @@ -151,7 +151,7 @@ def generate_statistics_from_tfrecord(pipeline_args, # type: List[str] if all_options["job_name"] is None: gcloud_options = pipeline_options.view_as(GoogleCloudOptions) - gcloud_options.job_name = "generatestats-%s" % str(time.time())[:-3] + gcloud_options.job_name = "generatestats-%s" % str(int(time.time())) if all_options["setup_file"] is None: setup_file_path = create_setup_file()