Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash should be an object? #379

Closed
pwalsh opened this issue Feb 27, 2017 · 12 comments
Closed

Hash should be an object? #379

pwalsh opened this issue Feb 27, 2017 · 12 comments

Comments

@pwalsh
Copy link
Member

pwalsh commented Feb 27, 2017

We currently support a special prefixing on the hash to declare hashing algorithms the are not MD5. However, we are moving away from this type of overloading in most all places in the spec.

So, I suggest:

"hash": {
  "type": "md5",
  "value": "{HASH}"
}
@pwalsh pwalsh added this to the v1.1 milestone Feb 27, 2017
@rufuspollock
Copy link
Contributor

@pwalsh agreed -- certainly for the "rigorous" version of the spec.

@rufuspollock
Copy link
Contributor

@pwalsh do we want to do this in v1.0?

@pwalsh
Copy link
Member Author

pwalsh commented May 29, 2017

@roll @akariv do you want this for v1.0, or is v1.1 ok?

@pwalsh pwalsh self-assigned this May 29, 2017
@roll
Copy link
Member

roll commented May 29, 2017

@pwalsh
It's breaking change. v1.0 vs v1.1 depends on breaking changes policy for the specs.

PS.
But I suppose no implementations uses it for now so it's more conceptual than practical question.

@rufuspollock
Copy link
Contributor

I have to say i also like the simplicity of a single value - no sub-object. Do we know what other systems do here e.g. debs etc?

@roll roll added this to Specifications in Frictionless General Mar 19, 2019
@fjuniorr
Copy link

@rufuspollock and @roll did this ever make to (some version) of the specs?

I've noticed that if I read a data package with frictionless.py with a string value in the hash property it will convert it to an object and add a hashing property.

That is, this datapackage.json

{
  "profile": "data-package",
  "resources": [
    {
      "profile": "data-resource",
      "name": "estados",
      "path": "estados.csv",
      "hash": "sha256:c280dab2e21da93be52aef5a4c934abdd4d70d9981f59372e3f36f4ca8b1ac38"
    }
  ],
  "name": "datapackage-reprex"
}

After

from frictionless import Package

dp = Package('datapackage.json')

dp.to_json('datapackage.json')

is serialized as

{
  "profile": "data-package",
  "resources": [
    {
      "profile": "data-resource",
      "name": "estados",
      "path": "estados.csv",
      "hashing": "sha256",
      "stats": {
        "hash": "c280dab2e21da93be52aef5a4c934abdd4d70d9981f59372e3f36f4ca8b1ac38"
      }
    }
  ],
  "name": "datapackage-reprex"
}

I'm starting to use this in a production context and it would be nice to know the recommended approach moving forward.

@rufuspollock
Copy link
Contributor

@fjuniorr i don't believe this ever made it into the spec so believe we are still with single string value with optional prefix.

@rgaiacs
Copy link
Contributor

rgaiacs commented Aug 12, 2022

Hi @rufuspollock can you share what is the plan to release v1.1 or v2 that covers stats?

@rjgladish
Copy link

rjgladish commented Aug 12, 2022 via email

@rufuspollock
Copy link
Contributor

@rgaiacs stats stuff is #364 i think. Do you want to comment there (especially on what you'd like to see)

@roll roll modified the milestones: v1.1, v2 Apr 14, 2023
@roll roll changed the title hash should be an object Hash should be an object Jan 3, 2024
@roll roll unassigned pwalsh Jan 3, 2024
@roll
Copy link
Member

roll commented Jan 3, 2024

Due to historical reasons, I propose to close this issue as wontfix.

For both publishers and implementors, there is really no difference whether this property is a string or an object, as it's very easy to use and implement any of them. I think there is no additional value to having changes here as for v2 and following, we strictly try to avoid breaking changes.

In general, what I think can really bring some additional value if we allow multiple hashes but it can be done just via a new non-breaking property like resource.hashes.[md5/sha256/etc] (although it really needs to be justified first)

@roll roll changed the title Hash should be an object Hash should be an object? Jan 3, 2024
@roll roll self-assigned this Jan 5, 2024
@roll
Copy link
Member

roll commented Jan 25, 2024

CLOSED as wontfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Frictionless General
  
Specifications
Development

No branches or pull requests

6 participants