Skip to content

Commit

Permalink
updates as per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
shaikh-ma authored Feb 5, 2025
1 parent 47edc6a commit c69785e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scrunch/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ def fork(self, description=None, name=None, is_published=False,
:returns _fork: scrunch.datasets.BaseDataset
"""
from scrunch.mutable_dataset import MutableDataset

# Handling project vs owner conflict
owner = kwargs.get("owner")

Expand Down Expand Up @@ -2426,14 +2426,15 @@ def fork(self, description=None, name=None, is_published=False,
if project:
# Create fork in given Project path.
try:
project = get_project(project).url
project_url = get_project(project).url
except KeyError:
# Creating full project URL for sub-folders
connection = _default_connection(connection=None)
site_url = connection.session.site_url
project = site_url + "/projects/{}/".format(project)
project_url = "{}/projects/{}/".format(
self.resource.session.site_url,
project
)
finally:
body["project"] = project
body["project"] = project_url
else:
raise ValueError(
"Project parameter should be provided when preserve_owner=False."
Expand Down

0 comments on commit c69785e

Please sign in to comment.