Skip to content

Commit 1519512

Browse files
authored
Merge pull request #2825 from SwissDataScienceCenter/release/v1.2.1
chore: release 1.2.1
2 parents b2e6ecd + 5efc059 commit 1519512

File tree

20 files changed

+86
-41
lines changed

20 files changed

+86
-41
lines changed

CHANGES.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
Changes
1919
=======
2020

21+
`1.2.1 <https://github.com/SwissDataScienceCenter/renku-python/compare/v1.2.0...v1.2.1>`__ (2022-04-11)
22+
-------------------------------------------------------------------------------------------------------
23+
24+
Bug Fixes
25+
~~~~~~~~~
26+
27+
- **core:** fix Plan.invalidated_at datetime not being timezone aware
28+
(`#2823 <https://github.com/SwissDataScienceCenter/renku-python/issues/2823>`__)
29+
(`df82f9f <https://github.com/SwissDataScienceCenter/renku-python/commit/df82f9fd8c481f6a6c177d1bdcd08484dbd46e79>`__)
30+
2131
`1.2.0 <https://github.com/SwissDataScienceCenter/renku-python/compare/v1.1.4...v1.2.0>`__ (2022-04-08)
2232
-------------------------------------------------------------------------------------------------------
2333

helm-chart/renku-core/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ appVersion: "1.0"
33
description: A Helm chart for Kubernetes
44
name: renku-core
55
icon: https://avatars0.githubusercontent.com/u/53332360?s=400&u=a4311d22842343604ef61a8c8a1e5793209a67e9&v=4
6-
version: 1.2.0
6+
version: 1.2.1

helm-chart/renku-core/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ versions:
109109
fullnameOverride: ""
110110
image:
111111
repository: renku/renku-core
112-
tag: "v1.2.0"
112+
tag: "v1.2.1"
113113
pullPolicy: IfNotPresent
114114
v8:
115115
name: v8

renku/command/checks/validate_shacl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from renku.command.schema.project import ProjectSchema
2626
from renku.core.interface.dataset_gateway import IDatasetGateway
2727
from renku.core.util.shacl import validate_graph
28-
from renku.domain_model.jsonld import NoDatesSafeLoader
28+
from renku.core.util.yaml import NoDatesSafeLoader
2929

3030

3131
def _shacl_graph_to_string(graph):

renku/command/schema/plan.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
"""Represent run templates."""
1919

20+
from datetime import timezone
21+
2022
import marshmallow
2123

2224
from renku.command.schema.calamus import JsonLDSchema, Nested, fields, prov, renku, schema
@@ -49,3 +51,14 @@ class Meta:
4951
outputs = Nested(renku.hasOutputs, CommandOutputSchema, many=True, missing=None)
5052
parameters = Nested(renku.hasArguments, CommandParameterSchema, many=True, missing=None)
5153
success_codes = fields.List(renku.successCodes, fields.Integer(), missing=[0])
54+
55+
@marshmallow.pre_dump
56+
def _pre_dump(self, in_data, **kwargs):
57+
"""Fix data on dumping."""
58+
if in_data.invalidated_at is not None and in_data.invalidated_at.tzinfo is None:
59+
# NOTE: There was a bug that caused invalidated_at to be set without timezone (as UTC time)
60+
# so we patch in the timezone here
61+
in_data.unfreeze()
62+
in_data.invalidated_at = in_data.invalidated_at.replace(microsecond=0).astimezone(timezone.utc)
63+
in_data.freeze()
64+
return in_data

renku/command/workflow.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import itertools
2222
import re
2323
from collections import defaultdict
24-
from datetime import datetime
2524
from functools import reduce
2625
from pathlib import Path
2726
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast
@@ -133,7 +132,7 @@ def _remove_workflow(name: str, force: bool, plan_gateway: IPlanGateway):
133132

134133
plan = plan or workflows[name]
135134
plan.unfreeze()
136-
plan.invalidated_at = datetime.utcnow()
135+
plan.invalidated_at = local_now()
137136
plan.freeze()
138137

139138

renku/core/migration/m_0003__1_jsonld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
get_pre_0_3_4_datasets_metadata,
3131
is_using_temporary_datasets_path,
3232
)
33-
from renku.domain_model.jsonld import read_yaml, write_yaml
33+
from renku.core.util.yaml import read_yaml, write_yaml
3434

3535

3636
def migrate(migration_context):

renku/core/migration/m_0009__new_metadata_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
)
4949
from renku.core.migration.utils.conversion import convert_dataset
5050
from renku.core.util import communication
51+
from renku.core.util.yaml import load_yaml
5152
from renku.domain_model.entity import Collection, Entity
52-
from renku.domain_model.jsonld import load_yaml
5353
from renku.domain_model.project import Project
5454
from renku.domain_model.provenance.activity import Activity, Association, Generation, Usage
5555
from renku.domain_model.provenance.agent import Person, SoftwareAgent

renku/core/migration/models/v3.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from renku.core.migration.models.v9 import Person as OldPerson
2626
from renku.core.migration.models.v9 import generate_project_id, wfprov
2727
from renku.core.migration.utils import OLD_METADATA_PATH, generate_dataset_tag_id, generate_url_id, get_datasets_path
28+
from renku.core.util import yaml
2829
from renku.core.util.urls import get_host
29-
from renku.domain_model import jsonld
3030

3131

3232
class Base:
@@ -86,7 +86,7 @@ class Project(Base):
8686
@classmethod
8787
def from_yaml(cls, path, client):
8888
"""Read content from YAML file."""
89-
data = jsonld.read_yaml(path)
89+
data = yaml.read_yaml(path)
9090
self = ProjectSchemaV3().load(data)
9191

9292
if not self.creator:
@@ -107,7 +107,7 @@ def to_yaml(self, path):
107107
self.agent_version = __version__
108108

109109
data = ProjectSchemaV3().dump(self)
110-
jsonld.write_yaml(path=path, data=data)
110+
yaml.write_yaml(path=path, data=data)
111111

112112

113113
class Collection(Base):
@@ -166,7 +166,7 @@ class Dataset(Base):
166166
@classmethod
167167
def from_yaml(cls, path, client=None, commit=None):
168168
"""Read content from YAML file."""
169-
data = jsonld.read_yaml(path)
169+
data = yaml.read_yaml(path)
170170
self = DatasetSchemaV3(client=client, commit=commit).load(data)
171171
self._metadata_path = path
172172
return self
@@ -175,7 +175,7 @@ def to_yaml(self, path=None):
175175
"""Write content to a YAML file."""
176176
data = DatasetSchemaV3().dump(self)
177177
path = path or self._metadata_path or os.path.join(self.path, OLD_METADATA_PATH)
178-
jsonld.write_yaml(path=path, data=data)
178+
yaml.write_yaml(path=path, data=data)
179179

180180

181181
class PersonSchemaV3(JsonLDSchema):

renku/core/migration/models/v7.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from renku.command.schema.calamus import fields, prov, renku, schema
2525
from renku.core.migration.utils import OLD_METADATA_PATH, get_datasets_path
26-
from renku.domain_model import jsonld
26+
from renku.core.util import yaml
2727

2828
from .v3 import Base, DatasetFileSchemaV3, DatasetSchemaV3, UrlSchemaV3
2929

@@ -34,7 +34,7 @@ class Dataset(Base):
3434
@classmethod
3535
def from_yaml(cls, path, client=None, commit=None):
3636
"""Read content from YAML file."""
37-
data = jsonld.read_yaml(path)
37+
data = yaml.read_yaml(path)
3838
self = DatasetSchemaV7(client=client, commit=commit).load(data)
3939
self._metadata_path = path
4040
return self
@@ -43,7 +43,7 @@ def to_yaml(self, path=None):
4343
"""Write content to a YAML file."""
4444
data = DatasetSchemaV7().dump(self)
4545
path = path or self._metadata_path or os.path.join(self.path, OLD_METADATA_PATH)
46-
jsonld.write_yaml(path=path, data=data)
46+
yaml.write_yaml(path=path, data=data)
4747

4848

4949
class DatasetFileSchemaV7(DatasetFileSchemaV3):

0 commit comments

Comments
 (0)