Skip to content

Commit

Permalink
Merge pull request #955 from SFDO-Tooling/feature/snowfakery-3.6.0
Browse files Browse the repository at this point in the history
Release version 3.6.0
  • Loading branch information
jkasturi-sf authored Sep 29, 2023
2 parents ef72d8a + 088e6b6 commit 4560a51
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 70 deletions.
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ In the beginning, programmers created the databases. Now the databases were form

And so [Salesforce.org](http://salesforce.org/) said “Let there be data,” and there was Snowfakery. And it was good.

## Snowfakery 3.6.0

Added educational and non-profit fakers (#897)

Better error messages for missing database drivers. (#873)

Improve error message for random_record query into Salesforce org. (#844)

Simpler syntax for choice feature. (#441)

## Snowfakery 3.5.0

Snowfakery's Debug and CSV outputs now use the same format that Salesforce prefers. (#778)
Expand Down
1 change: 0 additions & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ diff-cover
mkdocs<1.3.0 # need to change Snowfakery monkey-patching before upgrade
mkdocs-exclude-search
pre-commit
pyright
pytest
pytest-cov
faker-microservice
Expand Down
100 changes: 53 additions & 47 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
# pip-compile --allow-unsafe requirements/dev.in
#
attrs==23.1.0
# via jsonschema
black==23.3.0
# via
# jsonschema
# referencing
black==23.7.0
# via -r requirements/dev.in
cachetools==5.3.0
cachetools==5.3.1
# via tox
certifi==2022.12.7
certifi==2023.7.22
# via
# -r requirements/prod.txt
# requests
cfgv==3.3.1
cfgv==3.4.0
# via pre-commit
chardet==5.1.0
chardet==5.2.0
# via
# diff-cover
# tox
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via
# -r requirements/prod.txt
# requests
click==8.1.3
click==8.1.6
# via
# -r requirements/prod.txt
# black
Expand All @@ -38,15 +40,15 @@ coverage[toml]==6.5.0
# pytest-cov
coveralls==3.3.1
# via -r requirements/dev.in
diff-cover==7.5.0
diff-cover==7.7.0
# via -r requirements/dev.in
distlib==0.3.6
distlib==0.3.7
# via virtualenv
docopt==0.6.2
# via coveralls
exceptiongroup==1.1.1
exceptiongroup==1.1.2
# via pytest
faker==18.7.0
faker==19.3.0
# via
# -r requirements/prod.txt
# faker-edu
Expand All @@ -58,26 +60,22 @@ faker-microservice==2.0.0
# via -r requirements/dev.in
faker-nonprofit==1.0.0
# via -r requirements/prod.txt
filelock==3.12.0
filelock==3.12.2
# via
# tox
# virtualenv
ghp-import==2.1.0
# via mkdocs
greenlet==2.0.2
# via
# -r requirements/prod.txt
# sqlalchemy
gvgen==1.0
# via -r requirements/prod.txt
identify==2.5.23
identify==2.5.26
# via pre-commit
idna==3.4
# via
# -r requirements/prod.txt
# requests
# yarl
importlib-metadata==6.6.0
importlib-metadata==6.8.0
# via
# markdown
# mkdocs
Expand All @@ -88,11 +86,13 @@ jinja2==3.1.2
# -r requirements/prod.txt
# diff-cover
# mkdocs
jsonschema==4.17.3
jsonschema==4.19.0
# via -r requirements/dev.in
markdown==3.4.3
jsonschema-specifications==2023.7.1
# via jsonschema
markdown==3.4.4
# via mkdocs
markupsafe==2.1.2
markupsafe==2.1.3
# via
# -r requirements/prod.txt
# jinja2
Expand All @@ -108,7 +108,7 @@ multidict==6.0.4
# via yarl
mypy-extensions==1.0.0
# via black
nodeenv==1.7.0
nodeenv==1.8.0
# via
# pre-commit
# pyright
Expand All @@ -119,36 +119,34 @@ packaging==23.1
# pyproject-api
# pytest
# tox
pathspec==0.11.1
pathspec==0.11.2
# via black
platformdirs==3.5.0
platformdirs==3.10.0
# via
# black
# tox
# virtualenv
pluggy==1.0.0
pluggy==1.2.0
# via
# diff-cover
# pytest
# tox
pre-commit==3.3.1
pre-commit==3.3.3
# via -r requirements/dev.in
pydantic==1.10.7
pydantic==1.10.12
# via -r requirements/prod.txt
pygments==2.15.1
pygments==2.16.1
# via diff-cover
pyproject-api==1.5.1
pyproject-api==1.5.3
# via tox
pyright==1.1.305
pyright==1.1.322
# via -r requirements/dev.in
pyrsistent==0.19.3
# via jsonschema
pytest==7.3.1
pytest==7.4.0
# via
# -r requirements/dev.in
# pytest-cov
# pytest-vcr
pytest-cov==4.0.0
pytest-cov==4.1.0
# via -r requirements/dev.in
pytest-vcr==1.0.2
# via -r requirements/dev.in
Expand All @@ -159,7 +157,7 @@ python-dateutil==2.8.2
# -r requirements/prod.txt
# faker
# ghp-import
pyyaml==6.0
pyyaml==6.0.1
# via
# -r requirements/prod.txt
# mkdocs
Expand All @@ -169,19 +167,26 @@ pyyaml==6.0
# vcrpy
pyyaml-env-tag==0.1
# via mkdocs
referencing==0.30.2
# via
# jsonschema
# jsonschema-specifications
requests==2.29.0
# via
# -r requirements/prod.txt
# coveralls
# responses
responses==0.23.1
# via -r requirements/dev.in
rpds-py==0.9.2
# via
# jsonschema
# referencing
six==1.16.0
# via
# -r requirements/prod.txt
# python-dateutil
# vcrpy
sqlalchemy==1.4.48
sqlalchemy==1.4.49
# via -r requirements/prod.txt
tomli==2.0.1
# via
Expand All @@ -190,29 +195,30 @@ tomli==2.0.1
# pyproject-api
# pytest
# tox
tox==4.5.1
tox==4.8.0
# via
# -r requirements/dev.in
# tox-gh-actions
tox-gh-actions==3.1.0
tox-gh-actions==3.1.3
# via -r requirements/dev.in
types-pyyaml==6.0.12.9
types-pyyaml==6.0.12.11
# via responses
typing-extensions==4.5.0
typing-extensions==4.7.1
# via
# -r requirements/prod.txt
# black
# pydantic
urllib3==1.26.15
urllib3==1.26.16
# via
# -r requirements/prod.txt
# requests
# responses
vcrpy==4.2.1
# vcrpy
vcrpy==5.1.0
# via
# -r requirements/dev.in
# pytest-vcr
virtualenv==20.23.0
virtualenv==20.24.3
# via
# pre-commit
# tox
Expand All @@ -222,9 +228,9 @@ wrapt==1.15.0
# via vcrpy
yarl==1.9.2
# via vcrpy
zipp==3.15.0
zipp==3.16.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==67.7.2
setuptools==68.0.0
# via nodeenv
4 changes: 2 additions & 2 deletions requirements/prod.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ PyYAML
click
python-dateutil
gvgen
pydantic
pydantic<2.0.0
python-baseconv
requests
requests<=2.29.0 # There are issues with urllib on latest version
22 changes: 10 additions & 12 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#
# pip-compile --allow-unsafe requirements/prod.in
#
certifi==2022.12.7
certifi==2023.7.22
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
click==8.1.3
click==8.1.6
# via -r requirements/prod.in
faker==18.7.0
faker==19.3.0
# via
# -r requirements/prod.in
# faker-edu
Expand All @@ -19,33 +19,31 @@ faker-edu==1.0.0
# via -r requirements/prod.in
faker-nonprofit==1.0.0
# via -r requirements/prod.in
greenlet==2.0.2
# via sqlalchemy
gvgen==1.0
# via -r requirements/prod.in
idna==3.4
# via requests
jinja2==3.1.2
# via -r requirements/prod.in
markupsafe==2.1.2
markupsafe==2.1.3
# via jinja2
pydantic==1.10.7
pydantic==1.10.12
# via -r requirements/prod.in
python-baseconv==1.2.2
# via -r requirements/prod.in
python-dateutil==2.8.2
# via
# -r requirements/prod.in
# faker
pyyaml==6.0
pyyaml==6.0.1
# via -r requirements/prod.in
requests==2.29.0
# via -r requirements/prod.in
six==1.16.0
# via python-dateutil
sqlalchemy==1.4.48
sqlalchemy==1.4.49
# via -r requirements/prod.in
typing-extensions==4.5.0
typing-extensions==4.7.1
# via pydantic
urllib3==1.26.15
urllib3==1.26.16
# via requests
8 changes: 4 additions & 4 deletions snowfakery/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def create_cci_record_type_tables(db_url: str):
engine = create_engine(db_url)
metadata = MetaData()
metadata.reflect(views=True, bind=engine)
with engine.connect() as connection, connection.begin():
for tablename, table in list(metadata.tables.items()):
with engine.connect() as connection, connection.begin(): # type: ignore
for tablename, table in list(metadata.tables.items()): # type: ignore
record_type_column = find_record_type_column(
tablename, table.columns.keys()
)
Expand All @@ -37,12 +37,12 @@ def _populate_rt_table(
):
column = getattr(table.columns, columnname)
query_res = connection.execute(select(column).where(column is not None).distinct())
record_types = [res[0] for res in query_res if res[0]]
record_types = [res[0] for res in query_res if res[0]] # type: ignore

if record_types:
insert_stmt = rt_table.insert()
rows = [
dict(zip(rt_table.columns.keys(), (rtname, rtname)))
dict(zip(rt_table.columns.keys(), (rtname, rtname))) # type: ignore
for rtname in record_types
]

Expand Down
2 changes: 1 addition & 1 deletion snowfakery/tools/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Plugin(BasePlugin):
config_scheme = (
("build_locales", mkdocs.config.config_options.Type(bool, default=False)),
("build_locales", mkdocs.config.config_options.Type(bool, default=False)), # type: ignore
)

def on_config(self, config):
Expand Down
4 changes: 2 additions & 2 deletions snowfakery/tools/snowbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def status(tempdir, num_records, num_records_tablename, progress_bar):
start = time()
sleep(2)
previous_count = 0
for i in range(1, 10 ** 20):
for i in range(1, 10**20):
sleep(1)
if i in (2, 5, 10, 20, 30, 45, 90, 150) or (i % 60 == 0):
print()
Expand Down Expand Up @@ -163,7 +163,7 @@ def count_database(filename, counts):
dburl = f"sqlite:///{filename}?mode=ro"
engine = create_engine(dburl)
insp = inspect(engine)
tables = insp.get_table_names()
tables = insp.get_table_names() # type: ignore
for table in tables:
counts[table] += count_table(engine, table)
return counts
Expand Down
2 changes: 1 addition & 1 deletion snowfakery/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0
3.6.0

0 comments on commit 4560a51

Please sign in to comment.