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
# Make sure the table is created in the db even if it's empty. This is ugly, | |
# including in that every column will have type `string`, but the types will be | |
# fixed up as soon as there's actual data to load | |
if count == 0: | |
nulls_df = result_to_df([], field_info) | |
nulls_df = pd.concat( | |
[nulls_df, pd.DataFrame([{c: None for c in nulls_df.columns}])] | |
) | |
nulls_df.to_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
def load(connection, airtable, table_name, field_info, destination): | |
restarts = 0 | |
while True: | |
try: | |
chunks = airtable.iter_chunks(table_name) | |
# Airtable will give us the records in chunks of 100, which is | |
# inefficiently small for loading into Snowflake, so buffer them up into | |
# chunks of a few thousand | |
chunks = rechunked(chunks, 5000) | |
return _load_chunks(connection, chunks, field_info, destination) |
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
class AirtableClient: | |
# ... | |
def request(self, method, *args, **kwargs): | |
# ... | |
retries = 0 | |
wait = 30 | |
while True: | |
response = self.session.request(method, *args, headers=headers, **kwargs) | |
if response.status_code != 429 or retries == 3: |
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
metabase/redux/metadata fetchDatabaseMetadata | |
v @ app-main.bundle.js?a0cb8a0cb1424da110c7:1 | |
app-main.bundle.js?a0cb8a0cb1424da110c7:1 Error getting setting graph.x_axis._is_timeseries TypeError: Cannot read property 'cols' of undefined | |
at Object.getDefault (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at g (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at t.getComputedSettings (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at h (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at t.value (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at t.value (app-main.bundle.js?a0cb8a0cb1424da110c7:1) | |
at u.performInitialMount (vendor.bundle.js?a0cb8a0cb1424da110c7:1) |
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
09-16 16:08:02 [1mWARN middleware.process-userland-query[0m :: Query failure [31m{:status :failed, | |
:class java.sql.SQLNonTransientConnectionException, | |
:error "(conn=6989) Connection timed out (Write failed)", | |
:stacktrace | |
("org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:234)" | |
"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:165)" | |
"org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:238)" | |
"org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:232)" | |
"org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)" | |
"org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:174)" |
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
Process: TablePlus [5322] | |
Path: /Applications/TablePlus.app/Contents/MacOS/TablePlus | |
Identifier: com.tinyapp.TablePlus | |
Version: 2.8.3 (259) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: TablePlus [5322] | |
User ID: 503 | |
Date/Time: 2019-09-13 11:19:10.648 -0400 |
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
import java.util.Objects; | |
/** | |
* Class representing a playing card from a standard 52-card deck. | |
*/ | |
public class Card | |
{ | |
/** | |
* Enum representing playing card suits. | |
*/ |
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
;; This is just an example related to the discussion in this Emacs.SE question: | |
;; https://emacs.stackexchange.com/questions/20732/how-do-i-enable-indentation-in-an-inferior-scheme/ | |
(defun newline-indent-comint-send-input () | |
(interactive) | |
(newline-and-indent) | |
(comint-send-input)) | |
(with-eval-after-load 'cmuscheme | |
(define-key inferior-scheme-mode-map (kbd "RET") #'newline-indent-comint-send-input)) |
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
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) | |
(package-initialize) | |
(defvar my-packages '(slime auto-complete ac-slime) | |
"List of packages to install automatically.") | |
(let ((need (delq nil (mapcar (lambda (pkg) |
NewerOlder