• Thursday

    • Humidifier cleaning: https://cdn.accentuate.io/7062932586584/1649372746090/D1_02.00_M1_LUH-D302-WUS_2022-01-14_US_PRINT_en.pdf?v=0
    • Everything about poetry env management is for different python versions within a project: https://python-poetry.org/docs/managing-environments/. I wish you could create named envs per dependency set. I want a dev env. I want a test env. I want a doc env. I currently do poetry install --with [dev|test|doc] for those, which takes my single py3.11 project env and makes sure it has the proper deps, but that takes a few seconds – why can’t I just prebake envs that match those depsets and then (eg) poetry env use testenv?? I could create a my own venvs for these and pass the python executable path of them to poetry, but then there’s a required step outside of poetry for dependency management. Defeating the whole purpose of using a pkgmgr framework.
    • You can run flask db upgrade if you’re 2 versions behind, and it will apply them both in order.
    • Was going to switch verizon autopay to CSR (from boa debit), but remember that you get a big discount with debit. So left it. But the debit expires in 3 months. BoA should send me a new one, and I’ll change it. Added a calendar note.
    • Awesome video showing how much more frequently spacex has been launching over the years: https://twitter.com/stem_feed/status/1630971547434221578
    • You can’t just wrap a div around multiple td elements. Use selectors on the rows/cells as necessary.
    • SBSC. Finished the statuses/teams tables.
    • https://gitlab.com/bmahlstedt/supercontest/-/issues/175
    • Also moved ansible and flask-debugtoolbar to group.dev.dependencies. Added a devenv target to makefile and made it a requirement of other targets that do poetry run ansible <> (just like I do with testenv targets and docenv targets). Removed ipython from all depsets.
    • Bcrypt-hashed all the backfilled-users’ passwords (generic) with passlib via flask_user.
    • SQLA can only join to a table once. If you’re joining to a table twice because you have 2 FKs that you want to filter on (like Line.favored_team and Line.underdog_team requires 2 joins to the Team table), set up aliases for the table and join over the aliases. Note that the table aliases should be used in the filter as well.
    • With postponed evaluation of annotations (https://peps.python.org/pep-0563/), you don’t have to pass models in quotations to Mapped[<model>] attributes. But static analysis tools still flag it, since python doesn’t hoist. Going to leave them quoted.
    • Deployed new tables and app to prod.
  • Wednesday

    • Confirmed that I’m no longer getting the cloudwatch costs. The actions worked, either the removal of the dashboard or the only-send-disk-stats-for-/ rather than all 30 mounts.
    • ELB and EC2 cost cleanup will happen with the next few tickets.
    • Ordered a bunch of seeds for strawberries, flowers, and microgreens. Through rise gardens (with all my member discounts), it’s about $2/plant. Pretty good deal for produce (single-costs aside for hardware). Can go even lower if you buy the seeds separately and use the seedless pods.
    • Picked up the Ducati from MotorGrrl. Almost exactly 6 months in storage. Got a formal NYC inspection. Rode home smoothly. Total round trip was ~90min, not bad at all. Will do my maintenance later.
      • New garage policy – no battery tenders. I’ll plug it in later. Everything is by the book under new management right now, but they said that later it will ease up. Overall, Icon has been an extremely poor vendor for everything I need in a parking facility.
    • Updated to vscode 1.76: https://code.visualstudio.com/updates/v1_76
    • Note that WSL runs independently (as do all processes within). Vscode is obviously my shell into the machine and all my workspaces run there, but the actual VM is managed by docker desktop on the host.
    • SBSC. Continued on the data layer.
    • https://gitlab.com/bmahlstedt/supercontest/-/issues/175
    • Make sure to join the appropriate tables in a query if you’re conditioning on a relationship. If no where clause requires a child, then you can just select the parent table without any joins. Sqla will lazy load the relationships upon access. Best to be safe/explicit though.
    • Made the main matchups functionality just return list[Score] instead of list[Score, Line, Week, Season]. The appropriate children can be accessed via the transitive relationships. Same for picks. It returns list[Pick] only, instead of list[Pick, User, Score, Line, Week, Season].
    • The default cascade is False, or "save-update, merge". This applies when, for example, changing a Pick object; the Status child and the Line child are not deleted, since cascade="delete" is not specified.
    • Resolved this issue: Parent instance <x> is not bound to a Session; (lazy load/deferred load/refresh/etc.) operation cannot proceed (https://docs.sqlalchemy.org/en/20/errors.html#error-bhk3). It was due to flask_caching. Remember flask_sqlalchemy creates a scoped_session per request, so if your second request hits the cache, python will return the same result objects, but they’re dangling. So any access of child objects (via relationships) will fail with the above error.
    • You could change the loading paradigm (ie make another trip to the db to make the object in-session and not dangling), but then you’re making the cache worthless anyway.
    • Deleted the matchups and allpicks views in postgres. It’s just so much easier to query from python where the ORM allows easy joins and relationships.
    • Finished modeling the teams table and all FKs + relationships.
    • Successfully ran the migration.
    • Just need to update all callers now.
    • If you have multiple FKs linking 2 tables, you need to tell sqla which one to use when joining (in the relationship definition): https://docs.sqlalchemy.org/en/20/orm/join_conditions.html#handling-multiple-join-paths