-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
107 additions
and
254 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "3f833736-3f6c-45eb-ab64-39f8ee69d433", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from wrds2pg import wrds_update, make_engine, process_sql" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "860050e1-a996-4f4d-8707-6e5cc19237a9", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Forcing update based on user request.\n", | ||
"Beginning file import at 13:57:10 UTC.\n", | ||
"Importing data into audit_temp.auditsox302.\n", | ||
"Completed file import at 13:57:23 UTC.\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"updated = wrds_update(\"auditsox302\", \"audit_temp\",\n", | ||
" sas_schema=\"audit\",\n", | ||
" obs=1000,\n", | ||
" force=True,\n", | ||
" drop=\"prior: match: closest: ic_dc_text:\", \n", | ||
" col_types = {\"ic_dc_key\": \"integer\", \n", | ||
" \"is_effective\": \"integer\",\n", | ||
" \"material_weakness\": \"boolean\",\n", | ||
" \"sig_deficiency\": \"boolean\",\n", | ||
" \"noteff_acc_rule\": \"integer\",\n", | ||
" \"noteff_fin_fraud\": \"integer\",\n", | ||
" \"notefferrors\": \"integer\",\n", | ||
" \"noteff_other\": \"integer\",\n", | ||
" \"eventdate_aud_fkey\": \"integer\"})" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "424d62e0-b716-4462-adac-f04f5a3a3e59", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"engine = make_engine()\n", | ||
"process_sql(\"DROP TABLE audit_temp.auditsox302\", engine)\n", | ||
"process_sql(\"DROP SCHEMA audit_temp\", engine)\n", | ||
"process_sql(\"DROP ROLE audit_temp\", engine)\n", | ||
"process_sql(\"DROP ROLE audit_temp_access\", engine)\n", | ||
"engine.dispose()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |