-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOP-14063] Drop onetl._internal module
- Loading branch information
Showing
23 changed files
with
153 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SPDX-FileCopyrightText: 2021-2024 MTS (Mobile Telesystems) | ||
# SPDX-License-Identifier: Apache-2.0 | ||
def clear_statement(statement: str) -> str: | ||
""" | ||
Clear unnecessary spaces and semicolons at the statement end. | ||
Oracle-specific: adds semicolon after END statement. | ||
Examples | ||
-------- | ||
>>> clear_statement("SELECT * FROM mytable") | ||
'SELECT * FROM mytable' | ||
>>> clear_statement("SELECT * FROM mytable ; ") | ||
'SELECT * FROM mytable' | ||
>>> clear_statement("CREATE TABLE mytable (id NUMBER)") | ||
'CREATE TABLE mytable (id NUMBER)' | ||
>>> clear_statement("BEGIN ... END") | ||
'BEGIN ... END;' | ||
""" | ||
|
||
statement = statement.rstrip().lstrip("\n\r").rstrip(";").rstrip() | ||
if statement.lower().endswith("end"): | ||
statement += ";" | ||
return statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.