Software Engineering
We ship often
Shipping early is not enough. We also need to keep shipping tiny iterations daily instead of waiting months to ship something big.
Having a strong sense of urgency , and making hard decisions fast is how we enable that process. Our sprints only last 1 week and are quite short when compared to the rest of the industry - this is by... See more
Shipping early is not enough. We also need to keep shipping tiny iterations daily instead of waiting months to ship something big.
Having a strong sense of urgency , and making hard decisions fast is how we enable that process. Our sprints only last 1 week and are quite short when compared to the rest of the industry - this is by... See more
How we ship new features · Resend
factory_boy
factory_boy is a fixtures replacement based on thoughtbot's factory_bot.
As a fixtures replacement tool, it aims to replace static, hard to maintain fixtures with easy-to-use factories for complex objects.
Instead of building an exhaustive test setup with every possible combination of corner cases, factory_boy allows you to use objects... See more
factory_boy is a fixtures replacement based on thoughtbot's factory_bot.
As a fixtures replacement tool, it aims to replace static, hard to maintain fixtures with easy-to-use factories for complex objects.
Instead of building an exhaustive test setup with every possible combination of corner cases, factory_boy allows you to use objects... See more
FactoryBoy • GitHub - FactoryBoy/factory_boy: A test fixtures replacement for Python
Whenever you write a log, it’s important you choose the correct log level.
I personally mostly use ERROR, WARNING, INFO, or DEBUG (yes there are a few more).
Log levels TLDR
I personally mostly use ERROR, WARNING, INFO, or DEBUG (yes there are a few more).
Log levels TLDR
- ERROR: Parts of the flow failed, we want to send alerts to our on-call for this failures.
- WARNING: Doesn’t necessarily point to a failure, but an unexpected behavior that should
Logging practices I follow
Here's a list of those log levels from lowest precedence to highest:
notset (0) - Indicates that ancestor loggers should be consulted for the log level or that all events are logged (default setting)
debug (10) - Detailed information that would be of interest to the developer for diagnostic purposes
info (20) - Information that confirms that your... See more
notset (0) - Indicates that ancestor loggers should be consulted for the log level or that all events are logged (default setting)
debug (10) - Detailed information that would be of interest to the developer for diagnostic purposes
info (20) - Information that confirms that your... See more
Shortwave — The smartest email app on planet Earth
Your job involves turning the unknown into the known and translating vague ideas into actionable plans. This often involves a blend of:
- Detective work — ask the right questions, collect evidence, build a case theory, validate it
- Isolating uncertainty to the smallest components and proving / disproving theories
- Divide and conquer — breaking down the
3 Critical Skills You Need to Grow Beyond Senior Levels in Engineering
Comments are helpful sometimes. But sometimes, they are just an indication of bad code.The proper use of comments is to compensate for our failure to express ourself in code [1].Whenever you have to add a comment in your code, ask yourself if it is really required or if you could instead put that into a new function and name the function so that it... See more
How to Write Clean Code in Python
Some important formatting rules available in this style guide:
But remember: The formatting rules should make the code more readable. Sometimes,... See more
- Use four spaces for code indentation
- Limit all lines to a maximum of 79 characters
- Avoid extraneous whitespace in certain situations (i.e., inside brackets, between trailing comma and close parenthesis, ...)
But remember: The formatting rules should make the code more readable. Sometimes,... See more
How to Write Clean Code in Python
What is Hatchet?
Hatchet replaces difficult to manage legacy queues or pub/sub systems so you can design durable workloads that recover from failure and solve for problems like concurrency , fairness , and rate limiting . Instead of managing your own task queue or pub/sub system, you can use Hatchet to distribute your functions between a set of... See more
Hatchet replaces difficult to manage legacy queues or pub/sub systems so you can design durable workloads that recover from failure and solve for problems like concurrency , fairness , and rate limiting . Instead of managing your own task queue or pub/sub system, you can use Hatchet to distribute your functions between a set of... See more
hatchet-dev • GitHub - hatchet-dev/hatchet: A distributed, fault-tolerant task queue
But now we are only logging that error message. It would be better to define a custom Exception that we can then handle in our API in order to return a specific error code to the user:
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be... See more
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be... See more
How to Write Clean Code in Python
And then, in the primary function of your API:
try:
df = load_data('path/to/data.csv')
# Further processing and model prediction
except DataLoadError as e:
# Return a response to the user with the error message
# For example: return Response({"error": str(e)}, status=400)