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
Migration-Check: | |
stage: Test | |
services: | |
- postgres:11.5 | |
image: node:12.15-alpine | |
script: | |
- yarn run-migration:ci | |
- migration_result=$(yarn schema-log:ci) | |
- | | |
matching_migration_is_up_date=`echo $migration_result | grep 'Your schema is up to date - there are no queries to be executed by schema syncronization.'` |
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
const invoiceRepository = queryRunner.manager.getRepository("invoice"); | |
// or | |
const invoiceRepository = connection.getRepository<Invoice>("invoice"); |
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
import math | |
import pandas as pd | |
def read_csv_in_chunks(path, n_lines, **read_params): | |
if 'chunksize' not in read_params or read_params['chunksize'] < 1: | |
read_params['chunksize'] = 80000 | |
chunks = [0] * math.ceil(n_lines / read_params['chunksize']) | |
for i, chunk in enumerate(pd.read_csv(path, **read_params)): | |
percent = min(((i + 1) * read_params['chunksize'] / n_lines) * 100, 100.0) | |
print("#" * int(percent), f"{percent:.2f}%", end='\r', flush=True) |