Categories
CMS Drupal Mastering Development

hook_menu_local_tasks_alter is not invoked during functional tests

I have an implementation of hook_menu_local_tasks_alter in my module, which works fine on my dev environment, but when I try to run my module using BrowserTestBase the hook is not invoked when visiting a node. Why? Here is a mock instance of the hook that I’ve set up just to see if the hook is […]

Categories
Mastering Development

Perserver cookies between request AXIOS (Node.js)

$ node -v v10.15.0 "axios": "^0.19.2", I am trying to keep cookies from response header field ‘set-cookie’ – just like browsers do. I used to use this module (https://www.npmjs.com/package/request ) and there was an option request.defaults({jar: true}) which worked well. For axios I reqd that {withCredentials: true} would do the job – but it DOESN’T. […]

Categories
Mastering Development

Reading data from MySQL and writing in GCP Bucket using Apache Beam Python API

I’m trying to read data from MySQL database (located in GCP) and writing the same in GCP Bucket. I want to use Python SDK for the same. Below is the code I’ve written. from __future__ import generators import apache_beam as beam import time import jaydebeapi import os import argparse from google.cloud import bigquery import logging […]

Categories
Mastering Development

Unable to set the STOP-LOSS limit order using Binance Python API

I am attempting to create a LONG TRADE that will contain a BUY ORDER and a STOP-LOSS using Python asyncio, ccxt API (which is calling the Binance API for the Binance Crypto Exchange). First I create the BUY ORDER. Afterwards, I am waiting until the order is filled. AFTER it is filled, I am attempting […]

Categories
Mastering Development

Python requests with bearer token returns 401

I have api when called using Postman returns 200 and expected data. Similarly when urllib is used it returns 200 but fails when used requests. Note – All methods work correctly on external url but return 401 on localhost urllib code(returns 200): r = request.Request(myUrl) r.add_header(‘Accept’, ‘application/json’) r.add_header(‘Authorization’, f’Bearer {self.AUTH_TOKEN}’) response = request.urlopen(r, context=self.ctx) requests […]

Categories
Mastering Development System & Network

ERROR: (gcloud.app.deploy) UNAVAILABLE: The service is currently unavailable

Since last night App Engine has been throwing 503 errors for deploy, delete, and traffic migration requests. This is happening from both the CLI and the console. App Engine is still serving traffic, but it seems all the admin functions are not working. Others have reported this issue as well on the GCP Slack Error […]