diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index e408a6f2..546b2958 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -16,15 +16,16 @@ name: Codacy Security Scan on: schedule: - cron: '59 11 27 * *' - # push: - # branches: [ "master" ] - # pull_request: - # # The branches below must be a subset of the branches above - # branches: [ "master" ] - workflow_run: - workflows: [Test Changes] - types: - - completed + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + types: [opened, reopened, synchronize, ready_for_review] + # workflow_run: + # workflows: [Test Changes] + # types: + # - completed + workflow_call: workflow_dispatch: inputs: logLevel: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bc425d95..090b900f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,14 +14,16 @@ name: "CodeQL" on: schedule: - cron: '59 10 27 * *' - # push: - # branches: [ "master" ] - # pull_request: - # branches: [ "master" ] - workflow_run: - workflows: [Test Changes] - types: - - completed + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + types: [opened, reopened, synchronize, ready_for_review] +# workflow_run: + # workflows: [Test Changes] + # types: + # - completed + workflow_call: workflow_dispatch: inputs: logLevel: diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 01439065..2a3bfa82 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -7,7 +7,8 @@ on: push: branches: [ "master" ] pull_request: - types: [opened, reopened, synchronize, ready_for_review] # labeled + branches: [ "master" ] + types: [opened, reopened, synchronize, ready_for_review] workflow_dispatch: inputs: logLevel: @@ -19,14 +20,6 @@ on: - info - warning - debug - # tags: - # description: 'Test scenario tags' - # required: false - # type: boolean - # environment: - # description: 'Environment to run tests against' - # type: environment - # required: true jobs: run-guard: @@ -208,3 +201,25 @@ jobs: run: | cd docs sphinx-build -W -b singlehtml -d ../build/doctrees . ../build/singlehtml + + # TODO: 1 configuration not found: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview + # call-workflow-codeql: + # needs: test-source-code + # uses: ./.github/workflows/codeql-analysis.yml + # permissions: + # actions: read + # contents: read + # pull-requests: write + # security-events: write + # secrets: inherit # pass all secrets + + # call-workflow-codacity: + # needs: test-source-code + # uses: ./.github/workflows/codacy-analysis.yml + # permissions: + # actions: read + # contents: read + # pull-requests: write + # security-events: write + # secrets: inherit # pass all secrets + diff --git a/examples/notes/issue_219.py b/examples/notes/issue_219.py index 48b94f4a..4b612160 100644 --- a/examples/notes/issue_219.py +++ b/examples/notes/issue_219.py @@ -11,21 +11,20 @@ # -import sys -sys.path.insert(0, '../src') -import petl; print petl.VERSION -from petl.fluent import etl -import psycopg2 import MySQLdb +import psycopg2 -# +import petl +from petl.fluent import etl +# +print(petl.VERSION) tbl_dummy_data = etl().dummytable(100000) tbl_dummy_data.look() # -print tbl_dummy_data.nrows() +print(tbl_dummy_data.nrows()) # @@ -48,12 +47,12 @@ # # memory usage using default cursor -print etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2)) # # memory usage using server-side cursor -print etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2)) # @@ -77,10 +76,10 @@ # # memory usage with default cursor -print etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2)) # # memory usage with server-side cursor -print etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2))