Skip to content

Commit

Permalink
🟢
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrecamilleri committed Sep 23, 2024
1 parent b717d05 commit 6e177aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frictionless/resource/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ def __call__(
path = source
if isinstance(source, str):
path = helpers.join_basepath(source, basepath=basepath)
md_type = Detector.detect_metadata_type(path, format=options.get("format"))
md_type = options.get("datatype")
if not md_type:
md_type = Detector.detect_metadata_type(
path, format=options.get("format")
)
if md_type != "resource":
options["path" if isinstance(source, str) else "data"] = source
resource = cls(control=control, basepath=basepath, **options) # type: ignore
resource = cls( # type: ignore
control=control, basepath=basepath, **options
)
return cast(T, resource)

# Descriptor
Expand Down

0 comments on commit 6e177aa

Please sign in to comment.