This file contains hidden or 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
# Get the private key from a JSON file using `jq` | |
# and store it into the `PRIVATE_KEY` environment variable: | |
export PRIVATE_KEY=$(jq -r '.private_key' service-account.json) | |
# Print a suitable value for GitHub secrets: | |
echo $PRIVATE_KEY |
This file contains hidden or 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
create or replace view finservam.prod.position ( | |
symbol, exchange, date, trader, pm, num_shares_cumulative, cash_cumulative, close, | |
market_value, pnl comment 'Profit and Loss: Demonstrate comment on view column' | |
) | |
comment = 'what assets owned; demo Window Function running sum' | |
as | |
with cte as ( | |
select t.symbol, exchange, t.date, trader, pm, | |
sum(num_shares) over( | |
partition by t.symbol, exchange, trader |
This file contains hidden or 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
[build-system] | |
build-backend = "flit_core.buildapi" | |
requires = ["flit_core >=3.8.0,<4"] | |
[project] | |
name = "pyproject-toml-cheat-sheet" | |
version = "1.0.0" | |
authors = [ | |
{name = "Your Name", email = "[email protected]"}, | |
] |
This file contains hidden or 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
def make_tag_template_for_dashboard(self) -> TagTemplate: | |
tag_template = datacatalog.TagTemplate() | |
tag_template.display_name = 'Sisense Dashboard Metadata' | |
add_field(tag_template, 'id', STRING, 'Id') | |
add_field(tag_template, 'owner_username', STRING, 'Owner username') | |
add_field(tag_template, 'owner_name', STRING, 'Owner name') | |
add_field(tag_template, 'folder_id', STRING, 'Folder Id') | |
add_field(tag_template, 'folder_name', STRING, 'Folder Name') | |
add_field(tag_template, 'folder_entry', STRING, 'Data Catalog Entry for the Folder') |
This file contains hidden or 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
image: docker:19.03.12 | |
services: | |
- docker:19.03.12-dind |
This file contains hidden or 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
Test Docker with Cloud SDK image: | |
stage: test-custom-image | |
image: $CI_REGISTRY_IMAGE/docker-gcloud:latest | |
services: | |
- docker:19.03.12-dind | |
script: | |
- gcloud --version | |
- docker --version | |
- docker run hello-world |
This file contains hidden or 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
FROM docker:19.03.12 | |
# -------------------------------------------------------------------------- | |
# Install and configure gcloud. | |
# https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/a1754f1ccfa47c4cc5bd218a592d7df1051aaad6/alpine/Dockerfile | |
# for reference. | |
# -------------------------------------------------------------------------- | |
ARG CLOUD_SDK_VERSION=361.0.0 | |
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION | |
ENV PATH /google-cloud-sdk/bin:$PATH |
This file contains hidden or 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
try: | |
# Orchestration code here... | |
except Exception as e: | |
# Any exception that is raised by a function is re-raised by its enclosing | |
# activity task. The original error message is part of the new exception | |
# message, formatted as "Activity function '<function_name>' failed: | |
# <exception_type>: <exception_message>", so a regex is used to extract the | |
# original message and generate a friendlier output. | |
function_name = None | |
function_exception_type = None |
This file contains hidden or 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
def orchestrator_function(context: df.DurableOrchestrationContext): | |
output = [] | |
request_body = context.get_input() | |
data = yield context.call_activity('get-funds-transfer-data', request_body) | |
output.append('Get funds transfer data: DONE') | |
yield context.call_activity('validate-input', data) | |
output.append('Validate input: DONE') |
This file contains hidden or 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
def main(data: Dict[str, Any]) -> Dict[str, Any]: | |
if not data: | |
raise Exception('The funds transfer data is mandatory') | |
if not data.get('sourceAccount'): | |
raise Exception('The Source Account is mandatory') | |
if not data.get('targetAccount'): | |
raise Exception('The Target Account is mandatory') |
NewerOlder