Skip to main content

Posts

Airflow permission denied on BashOperator task execution

Beginner I have to run a python file in Airflow (with docker) but I am getting permission denied. The first task in this python file is to unzip some files from one folder and insert them into another already unzipped. These zips are taken from a datalake and placed in this directory, so they are just there to be unzipped. I'm not allowed to change this flow, so I need to keep things as they are, just orchestrating them with the airflow. This same python script runs without errors outside of Airflow, on the Ubuntu 20 command line. I've tried adding chmod commands in directories but it's not working. My dags are running in /opt/airfow/dags, the python script is in /opt/airflow/filepy and the files to unzip are in /opt/airflow/filepy/unzip/zip. This is the error from airflow This is the task call This is the part of python file encharged to unzip files # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE ...

AWS S3 Upload Unacceptably Slow

I have a React app using AWS Amplify . It takes about 2.5 minutes to upload a 1 MB (yes, 1 MB) image file to S3 bucket, which is unacceptably slow. I looked for similar questions and have not found any answers that worked. Here is my code: const s3Response = await Storage.put("filename.jpeg", file, { level: "protected", contentType: "image/jpeg" }); I am getting the file from an input type="file". EDIT: This ONLY happens on Mac OS. When I run the app in Firefox on Windows, it works very fast. When I run the app in Firefox on Mac, it takes minutes. Via Active questions tagged javascript - Stack Overflow https://ift.tt/itxMNS5

How to combine/merge a number list and a string list into a new list in ascending order in python using recursion?

I want to combine a number list and a string list in ascending order. Example a = [1, 2, 3], b = [a, b, c, d] combine a and b and the answer should be [1, a, 2, b, 3, c, d] or a = [1,2,3], b = [b, d] combine a and b and the answer should be [1, 2, b, 3, d] def combine(a, b): a = [str(int) for int in a] b = [str(int) for int in b] if a and b: if a[0] > b[0]: a, b = b, a return [a[0]] + combine(a[1:], b) return a + b a = [1, 2, 3] b = ['a', 'b', 'c', 'd'] combine(a, b) But I got this ['1', '2', '3', 'a', 'b', 'c', 'd'] source https://stackoverflow.com/questions/73806537/how-to-combine-merge-a-number-list-and-a-string-list-into-a-new-list-in-ascendin

Cannot load SVG's in Matter.js

I keep getting an error when trying to load an SVG in Matter-JS. I am basically copying and pasting code from the example to try and get this to work. I have installed poly-decomp and am using webpack and npm. The error is: "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'numberOfItems')" Here is the snippet of code where I am trying to load an SVG: // module aliases const Engine = Matter.Engine, Common = Matter.Common, Composite = Matter.Composite, Vertices = Matter.Vertices, Svg = Matter.Svg, Bodies = Matter.Bodies; // provide concave decomposition support library Common.setDecomp(require('poly-decomp')); const engine = Engine.create(), world = engine.world; if (typeof fetch !== 'undefined') { var select = function(root, selector) { return Array.prototype.slice.call(root.querySelectorAll(selector)); }; var loadSvg = function(url) { ret...

for loop for finding and storing words that is present in supplied word dataset returning name error

I have a list named 'result' as below >>> result [[['apple'],['banana'],['green','grapes'],nan],[['orange'],['hat'],['party','hat','2'],nan],[['blue'],['navy'],['red','t'],['angry']]] and I'm using gensim to match the words in the pretrained word2vec model with the words I have and get corresponding vectors. Given that the pretrained_model.key_to_index is structured as below, I used below code to store list of words within 'result' that is present in pretrained model named 'pretrained_model' and to filter the words that are not in pre trained model. >>> pretrained_model.key_to_index {'</s>': 0, 'in': 1, 'for': 2, 'that': 3, 'is': 4, 'on': 5, '##': 6, 'The': 7, 'with': 8, 'said': 9, ...

Tampermonkey script, make auto scroll with js

I want to make a tampermonkey script but I have zero knowledge. Purpose to read comic easier without scrolling. I want to make tampermonkey with button on the page, location: right, down side. When i click the button it will auto scroll from up to down. And also if you can add speed variant like a volume of youtube: drag up(slower), drag down(faster). I have an example of the auto scroll, links: https://codepen.io/michaelvinci/pen/qKVBLG?page=1& Here's the button look like on the web: Button on web here is code source From https://codepen.io/michaelvinci/pen/qKVBLG?page=1& : <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script><script src="./script.js"></script> and script.js let x = 0; let startScroll; $('.scrollable').scroll(function () { x = $(this).scrollTop(); }) $('#scroll-slider').on('input', function () { clearInterval(startScroll); if ($('#...

After creating app using npx create-react-app

npm ERR! code ENOENT npm ERR! syscall open npm ERR! path E:\React js web\TextEdits/package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'E:\React js web\TextEdits\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\rehma\AppData\Local\npm-cache_logs\2022-09-20T19_31_34_823Z-debug-0.log Via Active questions tagged javascript - Stack Overflow https://ift.tt/lGtBC26