@@ -61,8 +61,6 @@ def to_apify_request(scrapy_request: ScrapyRequest, spider: Spider) -> ApifyRequ
6161 logger .warning ('Failed to convert to Apify request: Scrapy request must be a ScrapyRequest instance.' )
6262 return None
6363
64- logger .debug (f'to_apify_request was called (scrapy_request={ scrapy_request } )...' )
65-
6664 # Configuration to behave as similarly as possible to Scrapy's default RFPDupeFilter.
6765 #
6866 # The body is stored twice on purpose: as `payload` (used for the extended unique key) and inside the serialized
@@ -150,7 +148,6 @@ def to_apify_request(scrapy_request: ScrapyRequest, spider: Spider) -> ApifyRequ
150148 # a second base64 layer would only add ~33% overhead on the enqueue path.
151149 apify_request .user_data ['scrapy_request' ] = scrapy_request_json
152150
153- logger .debug (f'scrapy_request was converted to the apify_request={ apify_request } ' )
154151 return apify_request
155152
156153
@@ -171,14 +168,10 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ
171168 if not isinstance (cast ('Any' , apify_request ), ApifyRequest ):
172169 raise TypeError ('apify_request must be an apify.Request instance' )
173170
174- logger .debug (f'to_scrapy_request was called (apify_request={ apify_request } )...' )
175-
176171 # If the apify_request comes from the Scrapy
177172 if 'scrapy_request' in apify_request .user_data :
178173 # Deserialize the Scrapy ScrapyRequest from the apify_request by parsing the stored JSON and reconstructing
179174 # the Scrapy ScrapyRequest object from its dictionary representation.
180- logger .debug ('Restoring the Scrapy ScrapyRequest from the apify_request...' )
181-
182175 scrapy_request_json = apify_request .user_data ['scrapy_request' ]
183176 if not isinstance (scrapy_request_json , str ):
184177 raise TypeError ('the stored scrapy_request must be a string' )
@@ -194,8 +187,6 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ
194187 if not isinstance (scrapy_request , ScrapyRequest ):
195188 raise TypeError ('scrapy_request must be an instance of the ScrapyRequest class' )
196189
197- logger .debug (f'Scrapy ScrapyRequest successfully reconstructed (scrapy_request={ scrapy_request } )...' )
198-
199190 # Update the meta field with the meta field from the apify_request
200191 meta = scrapy_request .meta or {}
201192 meta .update ({'apify_request_unique_key' : apify_request .unique_key })
@@ -204,8 +195,6 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ
204195
205196 # If the apify_request comes directly from the Scrapy, typically start URLs.
206197 else :
207- logger .debug ('Gonna create a new Scrapy ScrapyRequest (cannot be restored)' )
208-
209198 scrapy_request = ScrapyRequest (
210199 url = apify_request .url ,
211200 method = apify_request .method ,
@@ -222,5 +211,4 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ
222211 if apify_request .user_data :
223212 scrapy_request .meta ['userData' ] = apify_request .user_data
224213
225- logger .debug (f'an apify_request was converted to the scrapy_request={ scrapy_request } ' )
226214 return scrapy_request
0 commit comments