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
--------------------------------------------------------------------------- | |
PicklingError Traceback (most recent call last) | |
<ipython-input-67-59601d7f9a60> in <module> | |
15 | |
16 bag = db.from_sequence(data) | |
---> 17 bag.map(validate_data).compute() | |
~/Library/Caches/pypoetry/virtualenvs/domi-IWOYYLRr-py3.7/lib/python3.7/site-packages/dask/base.py in compute(self, **kwargs) | |
164 dask.base.compute | |
165 """ |
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
from __future__ import unicode_literals | |
import pytest | |
from starscream.pipeline.stage import TransformStage | |
from pyspark.sql import functions as F, types as T | |
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
from __future__ import unicode_literals | |
import pytest | |
import starscream.reusable_stages as RS | |
from starscream.contract import Contract | |
from starscream.utils.dataframe import as_dicts, from_dicts | |
import pyspark.sql.types as T |
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
from __future__ import unicode_literals | |
import pytest | |
from starscream.pipeline.stage import TransformStage | |
from pyspark.sql import functions as F, types as T | |
from starscream.contract import Contract | |
from starscream.utils.dataframe import as_dicts, from_dicts |
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
FROM python:3.7.6-buster | |
# Set the working directory | |
RUN mkdir /opt/app | |
WORKDIR /opt/app | |
# Copy poetry files into docker image | |
COPY pyproject.toml . | |
COPY poetry.lock . |
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
import logging | |
import time | |
from dataclasses import dataclass | |
from typing import Any, Optional, Tuple | |
import requests | |
import yaml | |
from distributed import Client | |
from distributed.security import Security | |
from googleapiclient import discovery |
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
import numpy as np | |
def bayesian_rate_comparison( | |
control_successes, | |
control_samples, | |
test_successes, | |
test_samples, | |
prior_a=0, | |
prior_b=0 | |
): |
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
import os | |
from jinja2 import Environment, meta, Template | |
import pandas as pd | |
from pandas.testing import assert_frame_equal | |
import pandas.io.sql as psql | |
import psycopg2 | |
# All these constants would likely live in separate files | |
CONNECTION = psycopg2.connect( |
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
## Pandas | |
import great_expectations as ge | |
# Build up expectations on a sample dataset and save them | |
train = ge.read_csv("data/npi.csv") | |
train.expect_column_values_to_not_be_null("NPI") | |
train.save_expectation_suite("npi_csv_expectations.json") | |
# Load in a new dataset and test them | |
test = ge.read_csv("data/npi_new.csv") |
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
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.4.0/dist/confetti.browser.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> | |
<div id="bottom_of_page">Thanks for scrolling to the bottom 🙌</div> | |
<div>Enjoy some confetti 🎉</div> | |
<script> | |