devopshq / artifactory

dohq-artifactory: a Python client for Artifactory
https://devopshq.github.io/artifactory/
MIT License
273 stars 144 forks source link

Update README.md for aql example #436

Closed jandvorak-sol60279 closed 10 months ago

jandvorak-sol60279 commented 10 months ago

added "type" key for aql example for aql results to work correctly with from_aql method for ArtifactoryPath

if "type" isnt included in aql response dict(s) it will raise ArtifactoryException and thus example isnt working

    def from_aql(self, result):
        """
        Convert raw AQL result to pathlib object
        :param result: ONE raw result
        :return:
        """
        result_type = result.get("type")
        if result_type not in ("file", "folder"):
            raise ArtifactoryException(
                f"Path object with type '{result_type}' doesn't support. File or folder only"
            )
allburov commented 10 months ago

@jandvorak-sol60279 thank you!