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

Throw errors when dots are in fields in targets #1699

Merged
merged 3 commits into from
Mar 28, 2024
Merged

Conversation

Ekrekr
Copy link
Contributor

@Ekrekr Ekrekr commented Mar 27, 2024

Fixes #1362 (comment), which contains the explanation for this solution

Also update filename in utils to basename as it is more correct.

@@ -89,7 +89,7 @@ export class Assertion extends ActionBuilder<dataform.Assertion> {
}

if (!config.name) {
config.name = Path.fileName(config.filename);
config.name = Path.basename(config.filename);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i still think this capitalized import name is super weird (Path as opposed to path which would be more standard)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be called pathUtils instead. It's capitalized for importing our path.ts file, but lowercase for our node path imports

import * as path from "path";
.

Will update in a subsequent CL.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's fine as path everywhere, but up to you

core/session.ts Outdated
@@ -392,6 +392,16 @@ export class Session {
)
);

this.checkNoDotsInTargetFields(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to do this at the end of compilation? IMO it should be happening well before then - at action declaration time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are you suggesting to put it?

Would it be both:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything passes through the action constructors, right? So we should only do it there.

@Ekrekr Ekrekr requested a review from BenBirt March 28, 2024 17:16
@Ekrekr Ekrekr merged commit b165560 into main Mar 28, 2024
4 checks passed
@Ekrekr Ekrekr deleted the throw-dot-in-name-errors branch March 28, 2024 17:22
moker-spaghetti pushed a commit to moker-spaghetti/dataform that referenced this pull request May 26, 2024
…e-errors

Throw errors when dots are in fields in targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI Output Only shows up to the first "." in the filename
2 participants