Skip to content

Instantly share code, notes, and snippets.

View dfrnks's full-sized avatar

Douglas Francisco dfrnks

View GitHub Profile
import subprocess
from distutils.command.build import build as _build # type: ignore
import setuptools
# This class handles the pip install mechanism.
class build(_build): # pylint: disable=invalid-name
"""A build command class that will be invoked during package install.
The package built using the current setup.py will be staged and later
import re
import time
import pyarrow
import logging
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions
import subprocess
from distutils.command.build import build as _build # type: ignore
import setuptools
# This class handles the pip install mechanism.
class build(_build): # pylint: disable=invalid-name
"""A build command class that will be invoked during package install.
The package built using the current setup.py will be staged and later
import pyarrow
import argparse
import logging
import apache_beam as beam
from beam_mysql.connector import splitters
from beam_mysql.connector.io import ReadFromMySQL
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions
CREATE OR REPLACE FUNCTION
`id-projeto`.librarys.cleanse_string (text STRING)
RETURNS STRING AS (
REGEXP_REPLACE(LOWER(TRIM(text)), '[^a-zA-Z0-9 ]+', '')
)
CREATE TEMP FUNCTION cleanse_STRING(text STRING)
RETURNS STRING AS (REGEXP_REPLACE(LOWER(TRIM(text)), '[^a-zA-Z0-9 ]+', '') );
WITH
strings AS (
SELECT
' Hello, World!!! ' AS text
UNION ALL
SELECT
' I am $SPecial$ STRing ' AS text
@dfrnks
dfrnks / GoogleCloudDeployManagerExample1CreateV1Instance.yaml
Last active August 15, 2021 18:13
Google Cloud Deploy Manager - Example1 - Create V1 Instance
# Put all your resources under `resources:`. For each resource, you need:
# - The type of resource. In this example, the type is a Compute VM instance.
# - An internal name for the resource.
# - The properties for the resource. In this example, for VM instances, you add
# the machine type, a boot disk, network information, and so on.
#
# For a list of supported resources,
# see https://cloud.google.com/deployment-manager/docs/configuration/supported-resource-types.
resources:
- type: compute.v1.instance
# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2
pipelines:
default:
- step:
name: Deployment to test environment
...
- pipe: dfrnks/power-bi-publish:0.1.2
variables:
USERNAME: $USERNAME
PASSWORD: $PASSWORD
CLIENT_ID: $CLIENT_ID
CLIENT_SECRET: $CLIENT_SECRET
WORKSPACE: "The My Workspace"
DIRECTORY_PBIX: "workspaces/the_my_workspace"
GATEWAY: "My Gateway:My Data Source"
@dfrnks
dfrnks / bitbucket-pipeline.yml
Last active August 1, 2021 14:34
Exemplo bitbucket-pipeline.yml power-bi-publish
# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2
pipelines:
default:
- step:
name: 'Starting the pipe'