mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-12-03 15:28:28 +01:00
dvc.objects.cache: set type in a more compatible way
It turns out that diskcache.Disk saves passed arguments to the database and uses that all the time. So this means that we are not forward compatible as it breaks moving from newer version of DVC to an older one. We don't promise this, but this breaks our benchmarks which are probably not isolated enough. Regarding the use of cache, it is a bit iffy to extend it this way. We only need this type for error messages. We could consider removing this, but since the error message is documented and it's not too hard to extend this :), I decided to preserve the message.
This commit is contained in:
committed by
skshetry
parent
3f5757a0a5
commit
dc1d3e880a
@@ -17,7 +17,7 @@ def test_pickle_protocol_error(tmp_dir, disk_type):
|
||||
cache = Cache(
|
||||
directory,
|
||||
disk_pickle_protocol=pickle.HIGHEST_PROTOCOL + 1,
|
||||
disk_type=disk_type,
|
||||
type=disk_type,
|
||||
)
|
||||
with pytest.raises(DiskError) as exc, cache as cache:
|
||||
set_value(cache, "key", ("value1", "value2"))
|
||||
|
||||
Reference in New Issue
Block a user