Skip to content

Instantly share code, notes, and snippets.

View zanieb's full-sized avatar

Zanie Blue zanieb

View GitHub Profile
@zanieb
zanieb / first_flow.py
Last active March 9, 2022 22:47
testing!
from prefect import flow, get_run_logger
@flow
def my_flow():
get_run_logger().info("Hello world")
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/orion-dev-38/lib/python3.8/site-packages/h2/connection.py", line
224, in process_input
func, target_state = self._transitions[(self.state, input_)]
KeyError: (<ConnectionState.CLOSED: 3>, <ConnectionInputs.SEND_HEADERS: 0>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
from prefect import Flow, task, Parameter
@task
def foo():
print("foo")
@task
from prefect import Flow, Task, Parameter
class Foobar(Task):
pass
with Flow("example") as flow:
start_at = Parameter("start_at", default=0)
@zanieb
zanieb / git-pickfile.sh
Created July 18, 2023 21:21
Applies the contents of file(s) at the given ref (e.g. branch or commit) to the current working tree.
#!/usr/bin/env bash
#
# git-pickfile
#
# Applies the contents of file(s) at the given ref (e.g. branch or commit) to
# the current working tree. If there are no conflicts, the changes will be
# staged. If there are conflicts, the changes will need to be resolved and
# committed.
#
# Unlike `git checkout <ref> -- <file>`, this allows you to resolve conflicts
# Type parameters in type alias statements
from some_module import Bar
type Foo[T] = T # OK
type Foo[T] = list[T] # OK
type Foo[T: Forward] = T # OK
type Foo[*Ts] = Bar[Ts]
type Foo[**P] = Bar[P]
# Types used in aliased assignment should exist
@zanieb
zanieb / CHANGELOG.md
Last active August 7, 2023 20:27
Draft changelog for Ruff 0.0.283

What's Changed

Breaking Changes

Rules

  • [flake8-pyi] PYI019: detects if a type variable is used instead of Self in return annotations by @qdegraaf in astral-sh/ruff#6204
  • [flake8-pyi] PYI051: detects unions of Literal types by @LaBatata101 in astral-sh/ruff#6215
@zanieb
zanieb / uv-installer.sh
Created November 8, 2024 04:44
The installer for uv 0.5.0
#!/bin/sh
# shellcheck shell=dash
#
# Licensed under the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then
# The version of ksh93 that ships with many illumos systems does not
#!/bin/sh
# shellcheck shell=dash
#
# Licensed under the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then
# The version of ksh93 that ships with many illumos systems does not
# Licensed under the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
<#
.SYNOPSIS
The installer for uv 0.5.0