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
| PYENV_PYTHON_VERSION=3.8.18 | |
| VENV_NAME=revrec-airflow-3.8 | |
| pyenv install $PYENV_PYTHON_VERSION | |
| pyenv virtualenv $PYENV_PYTHON_VERSION $VENV_NAME | |
| pyenv activate $VENV_NAME | |
| #Switch between Python versions | |
| #To select a Pyenv-installed Python as the version to use, run one of the following commands: | |
| pyenv shell <version> -- select just for current shell session |
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
| Application Default Credential option in login options on connection setup step | |
| make sure to | |
| > gcloud auth application-default login | |
| before |
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
| def _skipcondition(execution_date, **_): | |
| first_valid_friday = datetime(2021, 4, 9) | |
| return (execution_date - first_valid_friday).days % 14 == 0 | |
| with DAG(dag_id='fortnightSchedule',default_args = default_args, schedule_interval = "0 17 * * 5", catchup=False) as dag: | |
| check_valid_friday = ShortCircuitOperator( | |
| task_id="check_if_correct_friday", | |
| python_callable=_skipcondition, | |
| provide_context=True, | |
| ) |
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
| month_mid = DummyOperator(task_id='month_mid') | |
| month_end = DummyOperator(task_id='month_end') | |
| def choose_branch(execution_date, **_): | |
| if execution_date.day == 15: | |
| return month_mid.task_id | |
| else: | |
| return month_end.task_id | |
| branching_step = BranchPythonOperator( |
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
| with | |
| tt1 as ( | |
| select * | |
| from | |
| (values | |
| (1, 'USD', 'website', 10), | |
| (2, 'USD', 'website', 11), | |
| (3, 'EUR', 'website', 24), |
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
| defaults write -g com.apple.mouse.scaling -float 5.0 |
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
| # Just add at the bottom which will create a green arrow in pycharm to run | |
| if __name__ == "__main__": | |
| dag.test() |
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
| https://github.com/pyenv/pyenv/issues/2112#issuecomment-1096478446 |
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
| do $transaction$ | |
| begin | |
| create function coalesce_r_sfunc(state anyelement, value anyelement) | |
| returns anyelement | |
| immutable parallel safe | |
| as | |
| $$ | |
| select coalesce(value, state); | |
| $$ language sql; |
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
| show dbs | |
| use Squarespace | |
| show collections | |
| var ids = ['602c5dc0efc2030d4291df0e','6035fd5c059eee439eee882f','6053c6d1f3355c535cc04e47','606215248057bd618dc5137c','60d601576bb37e5d3102137d','60ff11d5155ac81fd7cede37','611319535be1890a2749144e','6114c313c704e77895eae698','6115739f891a354cbc85def6','6115e81b7d61344c77941fb9','611abff9d530264ea5b6c353','611ae1240c2b7a3390599093','611c9d511ec44d5e09be2598','611cabc1715c1d61add3fa41','612535abfe57af7f21a9f803','6126707751522312c45ac2ba','6127bfb2e9b1fe462df174b2','61280966b9f95f36f0c60930','618075b4b792b8323a9055cb','6192abdeee3a4c569ef3acbe','619bea082fc3722e487a3c43','61ae4815d286a539078721f7','61b7cd55af4dd61e505f9190','6216cbe4d7ece475a9343c12','6216d3b676f316501d2f2301','6234fca9462c9b2961eb6fa9','6267337a1302cb2a51f6515f','62ac173ba76f8c56e8f32e26','62c86f4ac28ac55affa62799','62defe33b3112e1aa5672257','62fbf079911b8f7a11ec628a','637d23212c138a54a671b4f3','639cba22559adc69f295c8e7','63b6160b1d8a170788c801b8','63c7238082514a3fc0f76e7a','63ca53dac1078a7e5bf3022 |