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

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

Printing all pages after API request

I need’s some assistance to print all page number. In my example below, just my IDE console print page 1, how can I print all page: import json import pandas as pd import requests url=’https://unstats.un.org/SDGAPI/v1/sdg/Series/Data?seriesCode=SI_POV_DAY1&seriesCode=SI_POV_NAHC&seriesCode=SI_POV_EMP1_1524_TOT&seriesCode=SI_POV_EMP1_25UP_TOT&seriesCode=SN_ITK_DEFC&seriesCode=SH_STA_STNT&seriesCode=AG_PRD_ORTIND&seriesCode=DC_TOF_AGRL&seriesCode=SH_DYN_MORT&seriesCode=SH_STA_MORT&seriesCode=SH_STA_MALR1&seriesCode=SE_PRM_RDNG&seriesCode=SE_PRM_MATH&seriesCode=SE_PRM_GPITCH&seriesCode=DC_TOF_SCHIPSL&seriesCode=SP_DYN_MRBF18&seriesCode=SH_STA_FGMS&seriesCode=SG_GEN_PARL&seriesCode=SH_H2O_IMPR&seriesCode=SH_SAN_IMPR&seriesCode=ER_H2O_STRESS&seriesCode=DC_TOF_WASHL&seriesCode=EG_ELC_ACCS&seriesCode=EG_EGY_CLEAN&seriesCode=EG_FEC_RNEW&seriesCode=SL_TLF_15UP_UEM_TOT&seriesCode=SL_TLF_1524_UEM_TOT&seriesCode=SL_TLF_CHDLBR&seriesCode=SL_EMP_PCAP&seriesCode=DC_TOF_TRDCMDL&seriesCode=NV_IND_MANFPC&seriesCode=SL_TLF_MANF&seriesCode=GB_XPD_RSDV&seriesCode=DC_TOF_INFRAL&seriesCode=SL_EMP_GTOTL&seriesCode=DC_TRF_TOTDL&seriesCode=SI_RMT_COS&seriesCode=EN_LND_SLUM&seriesCode=EN_ATM_PM25&seriesCode=EN_DOMCMPC&seriesCode=EN_DOMCMPG&seriesCode=EN_MAT_DOMCMPT&seriesCode=ER_MRN_MPA&seriesCode=ER_PTD_MTN&seriesCode=ER_PTD_TERR&seriesCode=ER_RSK_LST&seriesCode=SG_REG_BRTH&seriesCode=VC_PRS_UNSEC&seriesCode=BX_TRF_PWKR&seriesCode=DT_TDS_DECT&seriesCode=SG_STT_CAPTY&seriesCode=IT_USE_ii99&areaCode=12&areaCode=24&areaCode=204&areaCode=72&areaCode=854&areaCode=108&areaCode=120&areaCode=132&areaCode=140&areaCode=148&areaCode=174&areaCode=178&areaCode=180&areaCode=384&areaCode=262&areaCode=818&areaCode=226&areaCode=232&areaCode=231&areaCode=266&areaCode=270&areaCode=288&areaCode=324&areaCode=624&areaCode=404&areaCode=426&areaCode=430&areaCode=434&areaCode=450&areaCode=454&areaCode=466&areaCode=478&areaCode=480&areaCode=504&areaCode=508&areaCode=516&areaCode=562&areaCode=566&areaCode=646&areaCode=678&areaCode=686&areaCode=690&areaCode=694&areaCode=706&areaCode=710&areaCode=728&areaCode=729&areaCode=748&areaCode=834&areaCode=768&areaCode=788&areaCode=800&areaCode=894&areaCode=716&timePeriod=%5B%221990%22%2C%222019%22%5D’ r=requests.get(url) headers={ "content-security-policy": "frame-src ‘self’ https://*.arcgis.com https://www.youtube.com https://youtube.com https://*.twitter.com https://fonts.googleapis.com https://maxcdn.bootstrapcdn.com https://flickrembed.com/ https://public.tableau.com", "content-type": "application/json; charset=utf-8", "date": "Tue, 30 Jun […]

Categories
Mastering Development

Python requests 401 Unauthorized

I’m trying to log in to a cloudflare server based website. I bypassed the login issues using cloudserver, but my next stop point has been when I tried to send a get request to have access to some post login tokens. My code: headers = { ‘authority’: ‘www.paf.es’, ‘accept’: ‘application/json, text/plain, */*’, ‘user-agent’: ‘Mozilla/5.0 (Windows […]

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 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 […]

Categories
Development

Getting Model Invalid message with Azure Form Recognizer API

I am trying to use Microsoft Azure Form Recognizer API to upload Invoice pdf and get table info inside it. I was able to make a successful POST request. But not able to train the model and getting an error that ‘No valid blobs found in the specified Azure blob container. Please conform to the […]

Categories
Development iOS

Axios configuration headers being ignored

I’m using Axios with React Native. To deal with cache I set the headers as follow: await axios({ method: ‘get’, url: someURL, params: { username: username, }, headers: { ‘cache-Control’: ‘no-cache, no-store, max-age=0, must-revalidate’} }) However, when I printed response.config.headers and response.headers I got this: response.config.headers Object { “Accept”: “application/json, text/plain, */*”, “cache-Control”: “no-cache, no-store, […]

Categories
Development JSON

How to remove or prevent escape slashes from json-file data in azure logic app workflow

Situation I’m using Azure Logic App to do the following steps: Load/read a JSON file from blob storage. This file is created and written in R, using the toJSON function fromt JSONlite package Get de file content from this JSON file Convert it to a JSON format (using expression json()) Insert the converted output into […]