-
Notifications
You must be signed in to change notification settings - Fork 24
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
In NML upload with overwritingDatasetId, do not require valid orga field in the NML #8258
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request involve modifications to the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
app/models/annotation/nml/NmlParser.scala (2)
86-86
: Consider using a public accessor method for organization.The direct access of
_organization
suggests it might be a private field. Consider using a public accessor method (e.g.,dataset.getOrganization()
) to maintain better encapsulation.- organizationId = Some(dataset._organization), + organizationId = Some(dataset.getOrganization),- Some(dataset._organization), + Some(dataset.getOrganization),Also applies to: 116-116
Line range hint
411-412
: Document the optional nature of organization parsing.Since the organization field is no longer required when
overwritingDatasetId
is set, consider updating the method documentation to clarify this behavior.+ /** Parses the organization ID from the NML. Note: The result may be ignored when overwritingDatasetId is set, + * as the organization will be derived from the existing dataset instead. + */ private def parseOrganizationId(nodes: NodeSeq): String = nodes.headOption.map(node => getSingleAttribute(node, "organization")).getOrElse("")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
app/models/annotation/nml/NmlParser.scala
(2 hunks)
🔇 Additional comments (1)
app/models/annotation/nml/NmlParser.scala (1)
86-86
: LGTM! Changes align with PR objective.
The modification to source organizationId
from the dataset object instead of requiring it from the NML parameters aligns perfectly with the PR objective. This change ensures that when overwritingDatasetId
is set, the organization field in the NML is not required as it will be derived from the dataset that has already been looked up.
Also applies to: 116-116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR 🙏
Works great.
But while checking the code I noticed that NmlParsedParameters
organizationId
is still String
and not an option, although it is now optional. Maybe this should be changed 🤔. It currently works because parseOrganizationId
in NmlParser.scala
returns a ""
as default. But keep / do it the way you prefer :)
The orga id should be taken from the already looked-up dataset.
URL of deployed dev instance (used for testing):
Steps to test:
Issues: