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

add unary operators 'lowercase' and 'uppercase' #541

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

TungstnBallon
Copy link
Contributor

adds the lowercase and lowercase operators.

I adapted `cars.jv* to demonstrate them. This file adds 2 new columns, one for the lowercase and one for the uppercase name.

pipeline CarsPipeline {

	CarsExtractor
        -> CarsTextFileInterpreter
		-> CarsCSVInterpreter
		-> NameHeaderWriter
	   	-> CarsTableInterpreter
        -> NameToLowerCase
        -> NameToUpperCase
		-> CarsLoader;

    block CarsExtractor oftype HttpExtractor {
	url: "https://gist.githubusercontent.com/noamross/e5d3e859aa0c794be10b/raw/b999fb4425b54c63cab088c0ce2c0d6ce961a563/cars.csv";
	}

	block CarsTextFileInterpreter oftype TextFileInterpreter { }

	block CarsCSVInterpreter oftype CSVInterpreter {
		enclosing: '"';
	}

	block NameHeaderWriter oftype CellWriter {
		at: cell A1;
		write: ["name"];
	}

	block CarsTableInterpreter oftype TableInterpreter {
		header: true;
		columns: [
			"name" oftype text,
			"mpg" oftype decimal,
			"cyl" oftype integer,
			"disp" oftype decimal,
			"hp" oftype integer,
			"drat" oftype decimal,
			"wt" oftype decimal,
			"qsec" oftype decimal,
			"vs" oftype integer,
			"am" oftype integer,
			"gear" oftype integer,
			"carb" oftype integer
		];
	}


	transform LowerCaseText {
		from inputValue oftype text;
		to outputValue oftype text;

		outputValue: lowercase inputValue;
	}

    transform UpperCaseText {
		from inputValue oftype text;
		to outputValue oftype text;

		outputValue: uppercase inputValue;
	}

    block NameToLowerCase oftype TableTransformer {
        inputColumns: ["name"];
        outputColumn: "name_lowercase";

        use: LowerCaseText;
    }

    block NameToUpperCase oftype TableTransformer {
        inputColumns: ["name"];
        outputColumn: "NAME_UPPERCASE";

        use: UpperCaseText;
    }

	block CarsLoader oftype SQLiteLoader {
		table: "Cars";
		file: "./cars.sqlite";
	}
}

closes #540
@rhazn

@TungstnBallon TungstnBallon linked an issue Apr 9, 2024 that may be closed by this pull request
4 tasks
Copy link

github-actions bot commented Apr 9, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@rhazn
Copy link
Contributor

rhazn commented Apr 9, 2024

Great, thanks! Please first sign the CLA (commenting the sentence the bot asks you to, then retriggering the check). Then you can add me as a reviewer (top right) and I'll get a notification to review this asap :).

@TungstnBallon TungstnBallon force-pushed the 540-feature-lowercaseuppercase-operator branch from bf7b4c5 to 716c17e Compare April 9, 2024 10:52
@TungstnBallon
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@rhazn
Copy link
Contributor

rhazn commented Apr 9, 2024

Looks good, now last thing left is officially requesting a review from me (top right, reviewers) and then I'll try to get to it asap.

If you have time left in the meantime, you can familiarize yourself with the type system a bit by trying to understand if we can allow string and regex values for a parameter (for this task #523).

@TungstnBallon TungstnBallon requested review from rhazn and removed request for georg-schwarz April 9, 2024 11:09
@georg-schwarz
Copy link
Member

Hey @TungstnBallon, I merged some changes in #539 that affect your changes. I suggest doing a git rebase to incorporate the changes.
I think you only need to update the import paths and imported classes/variables in string-transform-type-computer.ts to adapt your feature.

Let me know if you need help with that ;-)

Copy link
Contributor

@rhazn rhazn left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 .

Regarding review flow, what I do is:

  • Approve with comments: You can merge at any time, fixing the comments would be good but I'll leave it up to your best judgement how / if it makes sense.
  • Request changes: Don't merge before the comments are resolved. Once you consider the comments resolved, re-request a new review from the PR main page.

So in this case, you can use your best judgement if you want to accept my suggested changes or not and afterwards you are free to merge without a new review.

@TungstnBallon TungstnBallon force-pushed the 540-feature-lowercaseuppercase-operator branch from 716c17e to a41762e Compare April 10, 2024 07:44
@TungstnBallon TungstnBallon merged commit 7590227 into main Apr 10, 2024
3 checks passed
@TungstnBallon TungstnBallon deleted the 540-feature-lowercaseuppercase-operator branch April 10, 2024 07:52
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] lowercase/uppercase operator
3 participants